我使用命令行参数调用windows终端,以自动运行进程(为了可读性,省略了多窗格设置):
wt -M new-tab -d . --title "Foo" powershell.exe -NoExit -Command somecalculation.exe
但是,如果进程结束或中止,我不能使用arrow up + enter来重新运行进程:每次使用新的终端时,我都必须输入一次somecalculation.exe及其所有参数。涉及到许多具有不同进程的窗格,因此能够使用历史记录将是一件很棒的事情。
有没有一种方法可以调用powershell,让我做到这一点?
发布于 2020-11-11 09:14:20
发生的事情是将命令保存到varible。然后踢出变量的结果。
wt -M new-tab -d . --title "Foo" powershell.exe -NoExit -Command "$result = cmd /c somecalculation.exe; $result | out-file C:\temp\results.txt"https://stackoverflow.com/questions/64779050
复制相似问题