Dile a PowerShell ISE que no envíe stderr a Write-Error
La consola de PowerShell y el ISE de PowerShell se comportan de manera diferente cuando los ejecutables escriben en la secuencia de error estándar (stderr
). La consola (powershell.exe) lo muestra como salida estándar. Por ejemplo, cuando obtengo un estado con Mercurial en un no repositorio, se escribe en error estándar:
> hg st -R C:\Windows
abort: repository C:\Windows not found!
Sin embargo, en el PowerShell ISE (powershell_ise.exe
), ese error pasa a PowerShellWrite-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
¿Hay alguna forma de configurar el ISE para que se comporte como la consola, y no envíe la secuencia stderr aWrite-Error
?