Page MenuHomePhabricator

Parse Powershell output on standard error
AbandonedPublic

Authored by hach-que on Aug 27 2014, 6:31 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 2:35 PM
Unknown Object (File)
Fri, Apr 12, 7:56 PM
Unknown Object (File)
Fri, Apr 5, 8:27 AM
Unknown Object (File)
Fri, Mar 29, 11:08 AM
Unknown Object (File)
Fri, Mar 29, 1:30 AM
Unknown Object (File)
Wed, Mar 20, 11:17 PM
Unknown Object (File)
Mar 10 2024, 8:03 AM
Unknown Object (File)
Feb 17 2024, 6:23 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
powershell
Lint
Lint Passed
SeverityLocationCodeMessage
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:32TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:51TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:63TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:67TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:76TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:78TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:80TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:84TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:92TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:94TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:96TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:98TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:100TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:104TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:108TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:121TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:130TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:134TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:138TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:140TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:143TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:146TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:150TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:154TXT6Trailing Whitespace
Auto-Fixsrc/future/exec/__tests__/ExecPowershellTestCase.php:156TXT6Trailing Whitespace
Unit
Tests Passed
Build Status
Buildable 2361
Build 2365: [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.