powershell : Cannot process the XML from the 'Error' stream
See original GitHub issueSteps to reproduce
powershell -c {[console]::Error.Write('abc')} 2>&1`
Expected behavior
powershell : abc
At line:1 char:6
+ $q = powershell -c "[console]::Error.Write('abc')" 2>&1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (abc:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Actual behavior
powershell : Cannot process the XML from the 'Error' stream of
'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe': Data at the root level is invalid. Line 1, position 1.
At line:1 char:1
+ powershell -c {[console]::Error.Write('abc')} 2>&1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SyntaxError: (C:\WINDOWS\Syst...\powershell.exe:String) [], XmlException
+ FullyQualifiedErrorId : ProcessStreamReader_CliXmlError
Environment data
This repros on Full Framework build and on inbox PS v5.1 on Windows.
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.14393.0
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.0
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Name Value
---- -----
PSVersion 6.0.0-alpha
PSEdition WindowsPowerShell
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 3.0.0.0
GitCommitId v6.0.0-alpha.7-117-gbbddfe81a5a72f45e4a650cf3f42a0ca1eda86aa
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Executing PsExec64.exe from Poweshell throwing "Cannot ...
From my PowerShell script I am executing PSExec64.exe with below ... PsExec64.exe : Cannot process the XML from the 'Error' stream of ...
Read more >XML Error (Data at the root level is invalid) : r/PowerShell
Hello, I'm having an issue with a PowerShell script that I'm trying to ... Error: Cannot convert value "System.Object[]" to type "System.
Read more >Q: What's the proper way to run inspec under Windows?
inspec : Cannot process the XML from the 'Error' stream of 'c:\opscode\inspec\bin\inspec.bat': Root element is missing.
Read more >Write-Error (Microsoft.PowerShell.Utility)
The Write-Error cmdlet declares a non-terminating error. By default, errors are sent in the error stream to the host program to be displayed, ......
Read more >PowerShell v2 task reports error code 1 when pwsh
let's say i have a bug and used a command with a required param e.g. write-verbose then if i want to run it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Doesn’t repro for me on 7.0.0-beta1 on mac.
Fixed (unicode no bom)? (pwsh not powershell)