Title: Add a parameter to `Out-File` and `Out-String` to bring back the previous behavior that got changed by #17455 · Issue #17509 · PowerShell/PowerShell · GitHub
Open Graph Title: Add a parameter to `Out-File` and `Out-String` to bring back the previous behavior that got changed by #17455 · Issue #17509 · PowerShell/PowerShell
X Title: Add a parameter to `Out-File` and `Out-String` to bring back the previous behavior that got changed by #17455 · Issue #17509 · PowerShell/PowerShell
Description: For reference: Issue: #17452 PR that fixed the issue: #17455 Context summary The previous behavior in 7.2.x is: Out-File and Out-String remove escape sequences from the passed-in strings when $PSStyle.OutputRendering is Host or PlainText...
Open Graph Description: For reference: Issue: #17452 PR that fixed the issue: #17455 Context summary The previous behavior in 7.2.x is: Out-File and Out-String remove escape sequences from the passed-in strings when $PSSt...
X Description: For reference: Issue: #17452 PR that fixed the issue: #17455 Context summary The previous behavior in 7.2.x is: Out-File and Out-String remove escape sequences from the passed-in strings when $PSSt...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/17509
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add a parameter to `Out-File` and `Out-String` to bring back the previous behavior that got changed by #17455","articleBody":"For reference:\r\n- Issue: https://github.com/PowerShell/PowerShell/issues/17452\r\n- PR that fixed the issue: https://github.com/PowerShell/PowerShell/pull/17455\r\n\r\n### Context summary\r\n\r\nThe previous behavior in 7.2.x is: `Out-File` and `Out-String` remove escape sequences from the passed-in strings when `$PSStyle.OutputRendering` is `Host` or `PlainText`.\r\n\r\nThere are some problems with this behavior, especially when having `Host` to be the default value for `$PSStyle.OutputRendering`. See https://github.com/PowerShell/PowerShell/pull/17455#issuecomment-1147680515 for the details of those problems.\r\n\r\nTherefore, that behavior was changed by #17455 to be:\r\n- when the input object is pure string, these 2 cmdlets keep the string input unchanged regardless of the `RenderingOutput` setting\r\n- when the input object needs to have formatting views applied to it, these 2 cmdlets remove escape sequences from the formatting output strings based on the `RenderingOutput` setting, which is the same as the existing behavior.\r\n\r\n### Recommendation from PowerShell Committee\r\n\r\nThe committee reviewed #17455 and recommended to add a new parameter to `Out-String` and `Out-File` to keep the previous behavior. Quote the comments https://github.com/PowerShell/PowerShell/pull/17455#pullrequestreview-1000516051 and https://github.com/PowerShell/PowerShell/pull/17455#issuecomment-1150521455 below:\r\n\r\n> I think we should seriously consider adding a parameter to out-string and out-file which retains our current behavior. Perhaps a parameter `-AsPlainText` or some such will allow users to have the older behavior while we provide a safer default behavior.\r\n>\r\n> powershell-committee reviewed this, we would recommend adding a parameter to enable users to get back the previous behavior.\r\n> \r\n","author":{"url":"https://github.com/daxian-dbw","@type":"Person","name":"daxian-dbw"},"datePublished":"2022-06-09T01:30:46Z","url":"https://github.com/PowerShell/PowerShell/issues/17509"}
| 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:68acdfae-0907-da39-4871-0ed6c9a55a6d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D228:350A6F:15C011:1DE39C:6AFD8EF9 |
| html-safe-nonce | fc0fd50d9883f84a654ae0113042f46deac2e7c7c97c3fedec0484d2eda52d30 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjI4OjM1MEE2RjoxNUMwMTE6MURFMzlDOjZBRkQ4RUY5IiwidmlzaXRvcl9pZCI6IjQxOTkwNDQ2MTkxOTI2MDIzNjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f53881cc469e8f45b4a99c271a2098b28f7a87aba77b6379f733ce166283b555 |
| hovercard-subject-tag | issue:1265480534 |
| 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/17509/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aea5f64020c8facf00a674c2d9cf8e646878106d95360bb2bfb3a40a3354a8a4/PowerShell/PowerShell/issues/17509 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aea5f64020c8facf00a674c2d9cf8e646878106d95360bb2bfb3a40a3354a8a4/PowerShell/PowerShell/issues/17509 |
| og:image:alt | For reference: Issue: #17452 PR that fixed the issue: #17455 Context summary The previous behavior in 7.2.x is: Out-File and Out-String remove escape sequences from the passed-in strings when $PSSt... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | daxian-dbw |
| 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 | 927a6c5ab1c32b38830f1b9d3050c0b9e9aa92e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width