Title: Group-Object: StringBuilder parses value as format string · Issue #20914 · PowerShell/PowerShell · GitHub
Open Graph Title: Group-Object: StringBuilder parses value as format string · Issue #20914 · PowerShell/PowerShell
X Title: Group-Object: StringBuilder parses value as format string · Issue #20914 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/20914
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Group-Object: StringBuilder parses value as format string","articleBody":"### Prerequisites\n\n- [X] Write a descriptive title.\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [X] Search the existing issues.\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\n`Group-Object` in PowerShell 7.3.10 and below is able to group strings containing `{` and `}` characters.\r\n\r\nIn PowerShell 7.4 this fails.\n\n### Expected behavior\n\n```console\nPS\u003e '}' | Group-Object\r\n\r\nCount Name Group\r\n----- ---- -----\r\n 1 } {}}\n```\n\n\n### Actual behavior\n\n```console\nPS\u003e '}' | Group-Object\r\nGroup-Object: Input string was not in a correct format. Failure to parse near offset 1. Unexpected closing brace without a corresponding opening brace.\n```\n\n\n### Error details\n\n```console\nException :\r\n Type : System.FormatException\r\n TargetSite :\r\n Name : ThrowFormatInvalidString\r\n DeclaringType : System.ThrowHelper, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e\r\n MemberType : Method\r\n Module : System.Private.CoreLib.dll\r\n Message : Input string was not in a correct format. Failure to parse near offset 1. Unexpected closing brace without a corresponding opening brace.\r\n Source : System.Private.CoreLib\r\n HResult : -2146233033\r\n StackTrace :\r\n at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ReadOnlySpan`1 args)\r\n at Microsoft.PowerShell.Commands.GroupInfo.BuildName(List`1 propValues)\r\n at Microsoft.PowerShell.Commands.GroupObjectCommand.DoOrderedGrouping(OrderByPropertyEntry currentObjectEntry, Boolean noElement, List`1 groups, Dictionary`2 groupInfoDictionary, OrderByPropertyComparer\r\norderByPropertyComparer)\r\n at Microsoft.PowerShell.Commands.GroupObjectCommand.EndProcessing()\r\n at System.Management.Automation.CommandProcessorBase.Complete()\r\nCategoryInfo : NotSpecified: (:) [Group-Object], FormatException\r\nFullyQualifiedErrorId : System.FormatException,Microsoft.PowerShell.Commands.GroupObjectCommand\r\nInvocationInfo :\r\n MyCommand : Group-Object\r\n ScriptLineNumber : 1\r\n OffsetInLine : 7\r\n HistoryId : 54\r\n Line : '}' | Group-Object\r\n Statement : Group-Object\r\n PositionMessage : At line:1 char:7\r\n + '}' | Group-Object\r\n + ~~~~~~~~~~~~\r\n InvocationName : Group-Object\r\n CommandOrigin : Internal\r\nScriptStackTrace : at \u003cScriptBlock\u003e, \u003cNo file\u003e: line 1\n```\n\n\n### Environment data\n\n```powershell\nName Value\r\n---- -----\r\nPSVersion 7.4.0\r\nPSEdition Core\r\nGitCommitId 7.4.0\r\nOS Microsoft Windows 10.0.19045\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\n```\n\n\n### Visuals\n\n_No response_","author":{"url":"https://github.com/chrisdent-de","@type":"Person","name":"chrisdent-de"},"datePublished":"2023-12-13T13:13:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/20914/PowerShell/issues/20914"}
| 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:73d5bd97-bc8f-cc5e-283f-aa6b9fc1bba1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CDFE:129889:C7F30A:10DD619:6A5938B3 |
| html-safe-nonce | 2ad39052f222e91fb0c2f1ec5434ba5b15b58c016d408b75ddf4dc5eae553a81 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREZFOjEyOTg4OTpDN0YzMEE6MTBERDYxOTo2QTU5MzhCMyIsInZpc2l0b3JfaWQiOiI4NDcyMDEwMDM4OTY5OTcyOTE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9a1c4e18edc78a13155be970b9c5c61ebbfcb6798b226b21417cbeff39069656 |
| hovercard-subject-tag | issue:2039687722 |
| 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/20914/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a44e8b76184ed71a16754d2dbecd6fc21fb10ac8036683d2e7245112b1f1e251/PowerShell/PowerShell/issues/20914 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a44e8b76184ed71a16754d2dbecd6fc21fb10ac8036683d2e7245112b1f1e251/PowerShell/PowerShell/issues/20914 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chrisdent-de |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1b31c9453e1607b2781513084b4770f67217e549834c85b76960d7b13626f7c8 |
| 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 | 220f27779da5b92b5e17fcaef93e474cc8affba3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width