In Powershell, how do I redirect standard output to standard error?
I know I can do the converse with 2>&1
so I tried:
echo "Hello" 1>&2
but I get a silly error The '1>&2' operator is reserved for future use.
I ask because being able to do this would make it easier for me to debug another problem. See $LastExitCode=0 but $?=False in PowerShell. Redirecting stderr to stdout gives NativeCommandError
$output = & externalprog.exe 2>&1
. The variable stores the output that you want to be sent to standard error. – Andy Arismendi