我试图在PowerShell的循环中运行exe,但是程序以Press any key to continue结尾,所以我的循环挂起了。
我到目前为止的代码是:
foreach ($num in 1..50) { .\somethig.exe }在PowerShell中,我可以使用yes命令,但我找不到任何类似的命令
发布于 2014-10-16 15:39:22
假设你必须输入“y”才能跳过暂停,
PS> 1..3 | % { write-output y | cmd /c pause }
Press any key to continue . . .
Press any key to continue . . .
Press any key to continue . . .
PS>
PS> 1..50 | % { write-output y | .\something.exe }'%‘是Foreach-Object的别名
https://stackoverflow.com/questions/26398299
复制相似问题