【问题标题】:PowerShell run multi scriptsPowerShell 运行多个脚本
【发布时间】:2011-08-30 06:49:51
【问题描述】:

有没有办法创建一个运行多个脚本的脚本?此外,第一个脚本应该在允许启动下一个脚本之前完成。

例子:

.\script1.ps1 arg1

#wait until script1 is done
.\script2.ps1 arg1 arg2

#wait until script2 is done
.\script3.ps1 arg1 arg2

【问题讨论】:

    标签: powershell powershell-2.0


    【解决方案1】:

    您提供的示例是一个有效的脚本,只需将其放入脚本文件并运行即可。

    【讨论】:

      【解决方案2】:

      试试吧:

      .\script1.ps1 arg1;.\script2.ps1 arg1 arg2;.\script3.ps1 arg1 arg2
      

      【讨论】:

        猜你喜欢
        • 2021-08-16
        • 1970-01-01
        • 2022-01-23
        • 1970-01-01
        • 2018-06-25
        • 2015-06-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多