Title: Out-String should not append a trailing newline · Issue #14444 · PowerShell/PowerShell · GitHub
Open Graph Title: Out-String should not append a trailing newline · Issue #14444 · PowerShell/PowerShell
X Title: Out-String should not append a trailing newline · Issue #14444 · PowerShell/PowerShell
Description: Summary of the new feature/enhancement It should be possible to use Out-String in a manner that doesn't append a trailing newline, which is what it currently does and has always done. Note that -NoNewLine is not a solution, because it su...
Open Graph Description: Summary of the new feature/enhancement It should be possible to use Out-String in a manner that doesn't append a trailing newline, which is what it currently does and has always done. Note that -No...
X Description: Summary of the new feature/enhancement It should be possible to use Out-String in a manner that doesn't append a trailing newline, which is what it currently does and has always done. Note that...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/14444
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Out-String should not append a trailing newline","articleBody":"## Summary of the new feature/enhancement\r\n\r\nIt should be possible to use `Out-String` in a manner that doesn't _append a trailing newline_, which is what it currently does and has always done.\r\n\r\nNote that `-NoNewLine` is _not_ a solution, because it suppresses _all_ newlines, so that _two or more_ output lines are then simply directly concatenated (like `-join ''`; e.g. `1, 2 | Out-String -NoNewLine` yields `12`).\r\n\r\nHere's a demonstration of the problem:\r\n\r\n```powershell\r\n# CURRENT behavior:\r\nPS> ('foo' | Out-String) -replace '\\r?\\n', '\u003cnewline>'\r\nfoo\u003cnewline> # A newline was appended.\r\n```\r\n\r\nI see two options:\r\n\r\n* (a) Consider a breaking change - assuming it is justified to consider it a [Bucket 3: Unlikely Grey Area](https://github.com/PowerShell/PowerShell/blob/master/docs/dev-process/breaking-change-contract.md#bucket-3-unlikely-grey-area) change - and make `Out-String` _never_ append a trailing newline.\r\n\r\n* (b) Introduce a new switch, `-NoTrailingNewLine` (related: #5108)\r\n\r\n\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2020-12-16T19:23:11Z","url":"https://github.com/PowerShell/PowerShell/issues/14444"}
| 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:df2df0b5-c0ed-66a5-4f2e-4e495f58bfcb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9376:1CAEF:AD4264:F7E10D:6AFDA6E9 |
| html-safe-nonce | e36a07a7add1323ba72e29a1d55a132a24479c976e72fa7e748c1ac3449a8ac2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Mzc2OjFDQUVGOkFENDI2NDpGN0UxMEQ6NkFGREE2RTkiLCJ2aXNpdG9yX2lkIjoiMTY2MTM4Njg5MTk4MDU0NzgxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a63b730efbb36a059b637b8505b39b4ae5054e898039aad131e80f0677b411a9 |
| hovercard-subject-tag | issue:769208193 |
| 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/14444/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2d3417a5c599400cde2f0a32fe3750674685059dce284a5f2a4580b862a4643a/PowerShell/PowerShell/issues/14444 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2d3417a5c599400cde2f0a32fe3750674685059dce284a5f2a4580b862a4643a/PowerShell/PowerShell/issues/14444 |
| og:image:alt | Summary of the new feature/enhancement It should be possible to use Out-String in a manner that doesn't append a trailing newline, which is what it currently does and has always done. Note that -No... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| 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 | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width