Powershell中的start-process在执行完成后自动关闭Window

yin*_*hox 7 powershell window process

我发现如果我start-process在powershell中启动一个进程,新窗口将在执行完成后自动关闭,是否可以让它等待我的进一步命令关闭?

Dou*_*nke 8

尝试将其-noexit作为参数传递给powershell.exe您启动时.


Jac*_*kie 6

你的意思是启动命令提示符?对?如果是这样,希望以下脚本可能会有所帮助

Start-Process cmd -ArgumentList '/c','echo test' # auto close
Start-Process cmd -ArgumentList '/k','echo test' # keep waiting
Run Code Online (Sandbox Code Playgroud)