diff --git a/.globalconfig b/.globalconfig index bdb7d56b6bd..f24b46fbd4f 100644 --- a/.globalconfig +++ b/.globalconfig @@ -301,7 +301,7 @@ dotnet_diagnostic.CA1828.severity = suggestion dotnet_diagnostic.CA1829.severity = suggestion # CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder -dotnet_diagnostic.CA1830.severity = suggestion +dotnet_diagnostic.CA1830.severity = warning # CA1831: Use AsSpan or AsMemory instead of Range-based indexers when appropriate dotnet_diagnostic.CA1831.severity = warning diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs index aca38f8994b..b493410d8e1 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs @@ -336,7 +336,7 @@ private static void ProcessUnknownViewName(TerminatingErrorContext errorContext, { // unKnowViewFormatStringBuilder.Append(StringUtil.Format(FormatAndOut_format_xxx.UnknownViewNameError, viewName)); unKnowViewFormatStringBuilder.Append(StringUtil.Format(FormatAndOut_format_xxx.UnknownViewNameErrorSuffix, viewName, formatTypeName)); - unKnowViewFormatStringBuilder.Append(validViewFormats.ToString()); + unKnowViewFormatStringBuilder.Append(validViewFormats); } else { diff --git a/src/System.Management.Automation/engine/ManagementObjectAdapter.cs b/src/System.Management.Automation/engine/ManagementObjectAdapter.cs index 33dcfbd6e7b..58f582d09f1 100644 --- a/src/System.Management.Automation/engine/ManagementObjectAdapter.cs +++ b/src/System.Management.Automation/engine/ManagementObjectAdapter.cs @@ -873,7 +873,7 @@ internal static string GetMethodDefinition(MethodData mData) builder.Append("System.Management.ManagementBaseObject "); builder.Append(mData.Name); builder.Append('('); - builder.Append(inParameterString.ToString()); + builder.Append(inParameterString); builder.Append(')'); string returnValue = builder.ToString(); diff --git a/src/System.Management.Automation/engine/ProxyCommand.cs b/src/System.Management.Automation/engine/ProxyCommand.cs index a388ccfc32d..5703adec664 100644 --- a/src/System.Management.Automation/engine/ProxyCommand.cs +++ b/src/System.Management.Automation/engine/ProxyCommand.cs @@ -441,7 +441,7 @@ public static string GetHelpComments(PSObject help) if (exsb.Length > 0) { sb.Append("\n\n.EXAMPLE\n\n"); - sb.Append(exsb.ToString()); + sb.Append(exsb); } } }