【发布时间】:2013-12-30 17:10:11
【问题描述】:
我有一个生成的文本文件,需要使用从命令提示符运行的程序进行验证。我正在尝试构建一个 powershell 脚本,它将运行命令并告诉我文本文件是否成功(没有错误)。当命令运行时,它只在屏幕上显示如下输出。
There were 0 warning, 0 fatal, and 0 system errors.
Please press Enter key to quit the program.
我目前正在使用下面的命令来给我这个输出。
Start-Process "C:\Program Files (x86)\file\file.exe" "C:\abc.txt" -NoNewWindow
我需要读取屏幕上的输出并通过字符串匹配确定结果是否成功(真/假)
非常感谢任何帮助/想法
【问题讨论】:
标签: powershell command prompt