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" 



No comments:

Post a Comment

Cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists

If you received below error while attaching a .mdf file in cluster environment please follow below steps to resolve the issue ERROR Ca...