From edfc3bd992cbc1102b2aa943d9732d14bc9257de Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 31 Oct 2023 10:06:36 -0700 Subject: [PATCH] Fix `Group-Object` so output uses current culture (#20608) --- .../commands/utility/Group-Object.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Group-Object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Group-Object.cs index 51f8f0a601..0f0a995196 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Group-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Group-Object.cs @@ -153,7 +153,7 @@ namespace Microsoft.PowerShell.Commands foreach (object item in propertyValueItems) { - sb.Append(CultureInfo.InvariantCulture, $"{item}, "); + sb.AppendFormat(CultureInfo.CurrentCulture, $"{item}, "); } sb = sb.Length > length ? sb.Remove(sb.Length - 2, 2) : sb; @@ -161,7 +161,7 @@ namespace Microsoft.PowerShell.Commands } else { - sb.Append(CultureInfo.InvariantCulture, $"{propValuePropertyValue}, "); + sb.AppendFormat(CultureInfo.CurrentCulture, $"{propValuePropertyValue}, "); } } }