【问题标题】:How I can I start a powershell command line from a batch file and enforce it to stay open?如何从批处理文件启动 powershell 命令行并强制它保持打开状态?
【发布时间】:2014-10-14 21:05:39
【问题描述】:

如何从批处理文件启动 powershell 会话,以便它启动 Powershell 命令行(然后导入一些模块)保持打开状态,而不是在命令运行后关闭蝙蝠。这样我就可以继续使用导入的模块在 PS Shell 命令行上工作。

谢谢

【问题讨论】:

    标签: powershell batch-file


    【解决方案1】:

    你可以试试这个。

    -noexit 将停止 powershell 以终止。

    start powershell.exe -noexit
    

    【讨论】:

    • 我可以通过提供一个powershell脚本文件来运行它吗?
    • 是的,它应该可以正常工作。 start powershell.exe -noexit -file <script>
    猜你喜欢
    • 2010-09-06
    • 1970-01-01
    • 1970-01-01
    • 2012-11-24
    • 2016-11-07
    • 1970-01-01
    • 2019-01-15
    • 1970-01-01
    • 2011-08-27
    相关资源
    最近更新 更多