我有一个批处理脚本,其中包含以下代码:
这是批处理脚本(Test.bat):
call powershell.exe -executionpolicy remotesigned -File TheScriptToBeExecuted.ps1
exit /b
这个 Powershell 脚本 (TheScriptToBeExecuted.ps1) 中已经内置了一些等待时间。但是当调用该文件时,批处理脚本并不会等待 Powershell 脚本完成。
我曾尝试过:
START /wait powershell.exe -executionpolicy remotesigned -File TheScriptToBeExecuted.ps1
毫无效果��
当我双击Test.bat文件时,它似乎在等待。我查看了很多答案,但没有找到与此问题相对应的答案。
请帮忙解决。
CALL
或START
命令。这些命令对于你要做的事情没有必要。 - Squashman