Title: Mapping file descriptors of pwsh process to Powershell streams · Issue #7989 · PowerShell/PowerShell · GitHub
Open Graph Title: Mapping file descriptors of pwsh process to Powershell streams · Issue #7989 · PowerShell/PowerShell
X Title: Mapping file descriptors of pwsh process to Powershell streams · Issue #7989 · PowerShell/PowerShell
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 bei...
Open Graph 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 ...
X 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, progr...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/7989
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mapping file descriptors of pwsh process to Powershell streams","articleBody":"Summary\r\n------------------\r\nI 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).\r\n\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\nPut the following code into a file `test`:\r\n\r\n```powershell\r\n#!/usr/bin/env pwsh\r\nWrite-Warning \"test\"\r\nWrite-Output \"[{ foo: 1 }]\"\r\n```\r\n\r\nIn some shell of your choosing, run the equivalent of:\r\n\r\n```bash\r\nchmod +x ./test\r\n./test 1>output 2>error\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\nThe file `output` should contain:\r\n\r\n```none\r\n[{ foo: 1 }]\r\n```\r\n\r\nActual behavior\r\n---------------\r\nThe file `output` contains:\r\n\r\n```none\r\nWARNING: test\r\n[{ foo: 1 }]\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\n> $PSVersionTable\r\nName Value\r\n---- -----\r\nPSVersion 6.1.0\r\nPSEdition Core\r\nGitCommitId 6.1.0\r\nOS Linux 4.18.9-arch1-1-ARCH #1 SMP PREEMPT Wed Sep 19 21:19:17 UTC 2018\r\nPlatform Unix\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```","author":{"url":"https://github.com/masaeedu","@type":"Person","name":"masaeedu"},"datePublished":"2018-10-10T21:55:14Z","url":"https://github.com/PowerShell/PowerShell/issues/7989"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7e6672fb-39a4-846f-0c9f-10b89867d192 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE40:332A98:179316:20FF2B:6AFDADB8 |
| html-safe-nonce | 0ec6f47922ffd7d6ac5cd53767fac8b37b1f98fc365c27065fdc060577d9dd51 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTQwOjMzMkE5ODoxNzkzMTY6MjBGRjJCOjZBRkRBREI4IiwidmlzaXRvcl9pZCI6IjYyNzY4MTU1NjIwODk1NDEwNDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 01ac9da7ebcd7200f7b2eac79f0f6e7be4e85d047ed1c29907e6a5f8284445b4 |
| hovercard-subject-tag | issue:368871439 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/7989/issue_layout |
| twitter:image | https://opengraph.githubassets.com/30fde167ce90c60d1fc6f321b937021800bf6e41bc72497e39d0a05971ea0674/PowerShell/PowerShell/issues/7989 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/30fde167ce90c60d1fc6f321b937021800bf6e41bc72497e39d0a05971ea0674/PowerShell/PowerShell/issues/7989 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | masaeedu |
| hostname | github.com |
| expected-hostname | github.com |
| None | bc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0ddf53eb35c87f1f8df13dbf75c3bdadbfc6e969 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width