Page MenuHomePhabricator

Parse Powershell output on standard error
AbandonedPublic

Authored by hach-que on Aug 27 2014, 6:31 AM.
Tags
None
Referenced Files
F12857967: D10363.id24946.diff
Fri, Mar 29, 11:08 AM
F12846725: D10363.diff
Fri, Mar 29, 1:30 AM
Unknown Object (File)
Wed, Mar 20, 11:17 PM
Unknown Object (File)
Sun, Mar 10, 8:03 AM
Unknown Object (File)
Feb 17 2024, 6:23 PM
Unknown Object (File)
Jan 30 2024, 11:48 PM
Unknown Object (File)
Dec 31 2023, 11:34 AM
Unknown Object (File)
Dec 23 2023, 10:45 PM

Details

Summary

Resolves T5976. So when Powershell thinks it doesn't have an output terminal, it will automatically encode all output to standard error in a terrible CLIXML format. No amount of command-line options will prevent this from occurring (I've tried). You also can't wrap the command on the Windows side of things, because in order to do any processing on that level, you'd need to execute Powershell (which would in turn encode it again), or output all standard error to a text file and then type it from Batch (which would lose the ability to stream the standard error to Harbormaster).

Test Plan

Direct your anger at Microsoft for writing such terrible software and then run the unit tests.

Diff Detail

Repository
rPHU libphutil
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 2516
Build 2520: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

hach-que retitled this revision from to Parse Powershell output on standard error.
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)
hach-que added a reviewer: epriestley.
hach-que edited edge metadata.

Remove trailing newlines by converting to single-quoted strings

I think I run this Test Plan at least daily, minus the unit tests

This should really be implemented as a ProtocolChannel, not on ExecFuture itself, but I'm not sure how plausible that is. Let me see if I can get it working.

also: omg are they serious what the hell

hach-que edited edge metadata.

Fix missing strlen call

Abandoning this because it's only necessary when running Powershell over SSH. Since WinRM is a much better way forward for remote commands on Windows, this is no longer needed.