powershell输出错误信息到文件

Posted Chuck Lu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell输出错误信息到文件相关的知识,希望对你有一定的参考价值。

https://stackoverflow.com/questions/8925323/redirection-of-standard-and-error-output-appending-to-the-same-log-file

 

The second way would look like this:

& myjob.bat 2>&1 >> C:\MyLog.txt

Or this:

& myjob.bat 2>&1 | Out-File C:\MyLog.txt -Append

以上是关于powershell输出错误信息到文件的主要内容,如果未能解决你的问题,请参考以下文章