Tuesday, April 4, 2017

how to invoke a second PS script with argument from a PS script


Inside the first power shell script use below statement to start second script.


Invoke-Expression "$scriptPath $argument"


E.g  Invoke-Expression "D:\PSScript\SecoundScript.ps1 $arg1"