-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
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 reproduce
Group-Object in PowerShell 7.3.10 and below is able to group strings containing { and } characters.
In PowerShell 7.4 this fails.
Expected behavior
PS> '}' | Group-Object
Count Name Group
----- ---- -----
1 } {}}Actual behavior
PS> '}' | Group-Object
Group-Object: Input string was not in a correct format. Failure to parse near offset 1. Unexpected closing brace without a corresponding opening brace.Error details
Exception :
Type : System.FormatException
TargetSite :
Name : ThrowFormatInvalidString
DeclaringType : System.ThrowHelper, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
MemberType : Method
Module : System.Private.CoreLib.dll
Message : Input string was not in a correct format. Failure to parse near offset 1. Unexpected closing brace without a corresponding opening brace.
Source : System.Private.CoreLib
HResult : -2146233033
StackTrace :
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ReadOnlySpan`1 args)
at Microsoft.PowerShell.Commands.GroupInfo.BuildName(List`1 propValues)
at Microsoft.PowerShell.Commands.GroupObjectCommand.DoOrderedGrouping(OrderByPropertyEntry currentObjectEntry, Boolean noElement, List`1 groups, Dictionary`2 groupInfoDictionary, OrderByPropertyComparer
orderByPropertyComparer)
at Microsoft.PowerShell.Commands.GroupObjectCommand.EndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
CategoryInfo : NotSpecified: (:) [Group-Object], FormatException
FullyQualifiedErrorId : System.FormatException,Microsoft.PowerShell.Commands.GroupObjectCommand
InvocationInfo :
MyCommand : Group-Object
ScriptLineNumber : 1
OffsetInLine : 7
HistoryId : 54
Line : '}' | Group-Object
Statement : Group-Object
PositionMessage : At line:1 char:7
+ '}' | Group-Object
+ ~~~~~~~~~~~~
InvocationName : Group-Object
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1Environment data
Name Value
---- -----
PSVersion 7.4.0
PSEdition Core
GitCommitId 7.4.0
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
Metadata
Metadata
Assignees
Labels
No labels