执行外部命令时阻止Powershell

res*_*sgh 0 powershell synchronization block

当您调用外部.exe命令时,如何使PowerShell阻塞直到外部结束?

Tre*_*van 5

Start-Process-Wait参数一起使用.

Start-Process -FilePath ipconfig.exe -ArgumentList '/?' -Wait;
Run Code Online (Sandbox Code Playgroud)