Closed
Description
Summary
I need a way to specify (using command line arguments to pwsh
) a mapping between Powershell streams and process file descriptors . Right now I can't see a way to prevent warnings, progress information, and debug messages from being munged together on stdout alongside data that needs to be in a particular format (e.g. JSON).
Steps to reproduce
Put the following code into a file test
:
#!/usr/bin/env pwsh
Write-Warning "test"
Write-Output "[{ foo: 1 }]"
In some shell of your choosing, run the equivalent of:
chmod +x ./test
./test 1>output 2>error
Expected behavior
The file output
should contain:
[{ foo: 1 }]
Actual behavior
The file output
contains:
WARNING: test
[{ foo: 1 }]
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0
PSEdition Core
GitCommitId 6.1.0
OS Linux 4.18.9-arch1-1-ARCH #1 SMP PREEMPT Wed Sep 19 21:19:17 UTC 2018
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0