Skip to content

Commit

Permalink
Fix regression in #20608. (#20745)
Browse files Browse the repository at this point in the history
  • Loading branch information
mawosoft committed Nov 30, 2023
1 parent 272a5a9 commit ac84c35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ private static string BuildName(List<ObjectCommandPropertyValue> propValues)

foreach (object item in propertyValueItems)
{
sb.AppendFormat(CultureInfo.CurrentCulture, $"{item}, ");
sb.Append(CultureInfo.CurrentCulture, $"{item}, ");
}

sb = sb.Length > length ? sb.Remove(sb.Length - 2, 2) : sb;
sb.Append("}, ");
}
else
{
sb.AppendFormat(CultureInfo.CurrentCulture, $"{propValuePropertyValue}, ");
sb.Append(CultureInfo.CurrentCulture, $"{propValuePropertyValue}, ");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ Describe "Group-Object" -Tags "CI" {
$result[0].Name | Should -Be ""
$result[0].Group | Should -Be '@{X=}'
}

It "Should handle format-like strings with curly braces like normal strings" {
$result = '{', '}', '{0}' | Group-Object
$result.Count | Should -Be 3
$result[0].Name | Should -BeExactly '{'
$result[1].Name | Should -BeExactly '{0}'
$result[2].Name | Should -BeExactly '}'
}
}

Describe "Check 'Culture' parameter in order object cmdlets (Group-Object, Sort-Object, Compare-Object)" -Tags "CI" {
Expand Down

0 comments on commit ac84c35

Please sign in to comment.