I am using powershell to run this very annoying program that writes all of its progress output to STDERR. I want the output of this command to be both printed on to the console AND saved to a file.
First, I used this: COMMAND | tee compile.log
. Everything looked good on the console, but the log file was empty. So, I tried this: COMMAND 2>&1 | tee compile.log
. This caused the log file to be written properly, but it caused huge issues:
- All output on the console was in the red error colour.
- No matter if the command was successful, the exit code is erroneous.
So, is there something I can use that will both display the progress in the console and write it to a file, but not look like an error?