I'm using System Center Orchestrator to run a PowerShell script that does some stuff. The component that executes the script is able to fetch the results of Write-Output
and Write-Host
but other streams are lost. But I'd really like those other streams to be available, especially the standard error stream.
Is there any way to setup redirection for stderr
to stdout
?
I know you can do this for individual commands doing 2>&1
but as the script has quite a few lines it would be kind of tedious to append this to every line in the script. I could execute a script within the script but that would lead to some other problems. My guess would be that it should be possible to set this up using C# but I'm not sure what to look for in that case.