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

后端 未结 6 2030
花落未央
花落未央 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:05

    If you don't want to hard code the path, you can make Master.ps1 like this:

    &"$PSScriptroot\1.ps1"
    &"$PSScriptroot\2.ps1"
    &"$PSScriptroot\3.ps1"
    

    And it will look for those scripts in the same directory where it is.

提交回复
热议问题