8000 Mapping file descriptors of pwsh process to Powershell streams · Issue #7989 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
Mapping file descriptors of pwsh process to Powershell streams #7989
Closed
@masaeedu

Description

@masaeedu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-Won't FixThe issue won't be fixed, possibly due to compatibility reason.WG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0