Run Multiple Powershell Scripts Sequentially - on a Folder - Combine Scripts into a Master Script

后端 未结 6 2031
花落未央
花落未央 2021-02-05 08:25

I have 6+ scripts and growing to run on a folder, what is the best way to have them run one after the other.

I have seen and tried this thread - it did not work unfortun

6条回答
  •  鱼传尺愫
    2021-02-05 09:01

    Are you hard coding the paths to the files in the master file?

    In this case something like this should work

    Invoke-Expression "C:\Users\WP\Desktop\Scripts\1.ps1"
    Invoke-Expression "C:\Users\WP\Desktop\Scripts\2.ps1"
    Invoke-Expression "C:\Users\WP\Desktop\Scripts\3.ps1"
    

提交回复
热议问题