且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

按顺序运行多个 Powershell 脚本 - 在一个文件夹上 - 将脚本组合成一个主脚本

更新时间:2023-01-08 16:28:17

如果不想硬编码路径,可以把Master.ps1做成这样:

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.