pywinrm icon indicating copy to clipboard operation
pywinrm copied to clipboard

PowerShell Write-Verbose, Progress, Information, Warning cause error output

Open HowardPWardinkle opened this issue 7 years ago • 4 comments

Only Write-Error is currently handled by pywinrm. Any other of the other PowerShell streams will output CLIXML and end up in Response.stderr.

I have created a PR that fixes this. It parses CLIXML and will put Warning, Verbose into Response.warning and Response.verbose. Information messages already come in to stdout, BUT they also are in the CLIXML so must be ignored to avoid Response.stderr output. Progress messages also are in CLIXML, but I ignore them.

HowardPWardinkle avatar Jun 30 '17 12:06 HowardPWardinkle

+1 we're having similar issues and would like to see this fixed

nmaludy avatar Jul 10 '17 19:07 nmaludy

+1 winrm.Session.run_ps() returns all other streams besides output to stderr. winrm only seems to process error stream into human-readable, all other streams are still marked up, causes headaches for client applications that check Response.std_err for any non-zero to indicate failure.

SheepReaper avatar Feb 03 '20 20:02 SheepReaper

Bump

omriiszero avatar Jun 28 '23 09:06 omriiszero

For me adding this fixed the issue. I added this line at beginning of every command I run using Session.run_ps $ProgressPreference = "SilentlyContinue"

desaiparv5 avatar Aug 29 '23 14:08 desaiparv5