I want to see the output of the command in the console and save it in a file so I have these two options:
When I use command | tee output.txt
somehow it generates no output file at all but it works as usual in the console.
When I use command 2>&1 | tee output.txt
it generates a fine output file but the text in the console appears in red.
Is there any way to either fix the first option or let the text appear as usual in the second one? I am using Windows PowerShell (Windows 10) and the Programm I am using this for is liquibase 3.5.5. just for the case that this is important.
command | out-string | tee output.txt
?2>&1
to capture its output.| tee
parameter generates no output file because it is an error stream?&1
) stream. You'd need to do& command 2>&1 | tee ...