Fix powershell2 write-output exception