From 9665ea5af6a30c8daf50cbba05580ea9803b52ec Mon Sep 17 00:00:00 2001 From: Matthias Wolf <78562192+mawosoft@users.noreply.github.com> Date: Tue, 21 Nov 2023 19:56:24 +0100 Subject: [PATCH] Fix regression in #20608. Fixes regression from #20608 which mixed up use of `StringBuilder.AppendFormat` and interpolated strings, thereby passing the actual value to be formatted as the format string. Fixes #20711. --- .../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 0f0a99519678..1f5272589395 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 @@ private static string BuildName(List 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; @@ -161,7 +161,7 @@ private static string BuildName(List propValues) } else { - sb.AppendFormat(CultureInfo.CurrentCulture, $"{propValuePropertyValue}, "); + sb.Append(CultureInfo.CurrentCulture, $"{propValuePropertyValue}, "); } } }