1. 程式人生 > >powershell輸出錯誤信息到文件

powershell輸出錯誤信息到文件

shel rec int ror dir ack erro rsh ref

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輸出錯誤信息到文件