当我从Powershell ISE中运行脚本时,它们会短暂打开一个cmd提示,然后关闭。该脚本已成功执行,但在关闭之前我什至没有机会看到结果。理想情况下,我希望输出仅显示在powershell中。
我运行的任何脚本都会发生这种情况,但这是一个基本示例,该示例更改到另一个目录并运行我的Postman测试:
cd C:\path\to\file\
.\newman -c "collections\PlatformRelease2.4.json" -e "collections\Platform20Release202.4" -o "newmanOutput.json"
cd C:\path\to\starting\dir
最佳答案
Newman是Postman的命令行收集运行程序。您正在执行第三方命令行程序,该程序会打开命令提示符。
尝试
Invoke-Expression '.\newman -c "collections\PlatformRelease2.4.json" -e "collections\Platform20Release202.4" -o "newmanOutput.json"'
关于powershell - 当执行脚本时,Powershell ISE将打开一个cmd提示符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25752798/