powershell - 快速启动本地应用程序
我正在低规格硬件上构建一个信息亭类型配置脚本。
在脚本的最后,它运行各种应用程序供用户交互。我目前使用普通的 Invoke-Command“path\to\app.exe
”。我希望尽快让界面启动并运行。我想异步启动应用程序。
我知道 Invoke-Command
中有 start-job 和 -asJob
标志,但它们似乎不适用于启动可视化应用程序。有办法做到这一点吗?
I am building a kiosk type config script on low-spec hardware.
At the end of the script, it runs the various apps for the user to interact with. I currently use a plain Invoke-Command "path\to\app.exe
". I want to get the interface up and running as quickly as possible. I want to launch the apps asynchronous.
I know there is start-job, and the -asJob
flag in Invoke-Command
, but they don't seem to work with launching visual apps. Is there a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,Windows 子系统(可视)EXE 异步启动。并且您不需要 Invoke-Command 来调用 exe。如果您像这样执行 notepad.exe:
请注意,当记事本仍在运行时,PowerShell 提示符会立即返回。这同样适用于脚本。
Windows subsystem (visual) EXEs start asynchronously by default. And you don't need Invoke-Command to invoke an exe. If you exeute notepad.exe like so:
Note that the PowerShell prompt returns immediately while notepad is still running. The same applies in a script.