Page MenuHomePhabricator

Parse Powershell output on standard error
AbandonedPublic

Authored by hach-que on Aug 27 2014, 6:31 AM.

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.