【发布时间】:2020-03-14 06:34:08
【问题描述】:
我正在从 .bat 运行一个 powershell 脚本,以使其双击友好。代码如下:
powershell.exe -ExecutionPolicy unrestricted -NoExit -command "Start-Process powershell -Verb RunAs" {<Location of .ps1 file here>; <arguments>; pause }
它运行良好,但完成后显示“按任意键继续”,powershell 窗口关闭,但我需要它保持打开状态,因为在脚本结束时它会显示一些额外的命令,我们需要运行以完成过程。
有什么想法吗?谢谢!
【问题讨论】:
标签: powershell batch-file scripting windows-server