The PowerShell console and the PowerShell ISE behave differently when executables write to the standard error stream (stderr
). The console (powershell.exe) displays it like standard output. For example, when I get a status with Mercurial on a non-repository, it writes to standard error:
> hg st -R C:\Windows
abort: repository C:\Windows not found!
However, in the PowerShell ISE (powershell_ise.exe
), that error gets passed to PowerShell's Write-Error
cmdlet:
> hg st -R C:\Windows
hg.exe : abort: repository C:\Windows not found!
At line:1 char:3
+ hg <<<< st -R C:\Windows
+ CategoryInfo : NotSpecified: (abort: repository C:\Windows not found!:String) [], RemoteExcepti
on
+ FullyQualifiedErrorId : NativeCommandError
Is there any way to configure the ISE to behave like the console, and not send the stderr stream to Write-Error
?