Skip to content

Commit

Permalink
Fix regression in PowerShell#20608.
Browse files Browse the repository at this point in the history
Fixes regression from PowerShell#20608 which mixed up use of `StringBuilder.AppendFormat` and interpolated strings, thereby passing the actual value to be formatted as the format string.

Fixes PowerShell#20711.
  • Loading branch information
mawosoft committed Nov 21, 2023
1 parent 094e22e commit 9665ea5
Showing 1 changed file with 2 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

0 comments on commit 9665ea5

Please sign in to comment.