Powershell - Calling multiple PS1 scripts from batch file keeping same session and global variables
Posted on 2010-08-26
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