Powershell - Calling multiple PS1 scripts from batch file keeping same session and global variables
I have several ps1 files:
I have variables that I would like 2 to use which are set by 1. I can set them global but that makes them available for the same session only. If I run the scripts via a batch file it creates new sessions for each ps1. Is there a way to open each ps1 using a single session via a batch file?
$a = 20
copy of current batch:
powershell . c:\powershell\powershellscripts\trial\1.ps1
powershell . c:\powershell\powershellscripts\trial\2.ps1
Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!