Enable CA1834: Consider using 'StringBuilder.Append(char)' when applicable (#13878)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1834
This commit is contained in:
parent
ac9846bf40
commit
af8558b065
|
@ -313,7 +313,7 @@ dotnet_diagnostic.CA1832.severity = suggestion
|
|||
dotnet_diagnostic.CA1833.severity = suggestion
|
||||
|
||||
# CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||
dotnet_diagnostic.CA1834.severity = suggestion
|
||||
dotnet_diagnostic.CA1834.severity = warning
|
||||
|
||||
# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'
|
||||
dotnet_diagnostic.CA1835.severity = suggestion
|
||||
|
|
|
@ -949,7 +949,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
if (propList.Length > 0)
|
||||
{
|
||||
propList.Append(",");
|
||||
propList.Append(',');
|
||||
}
|
||||
|
||||
propList.Append(property);
|
||||
|
|
|
@ -306,7 +306,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
StringBuilder propertyList = new StringBuilder();
|
||||
if (cmd.SelectProperties == null)
|
||||
{
|
||||
propertyList.Append("*");
|
||||
propertyList.Append('*');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -314,7 +314,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
if (propertyList.Length > 0)
|
||||
{
|
||||
propertyList.Append(",");
|
||||
propertyList.Append(',');
|
||||
}
|
||||
|
||||
propertyList.Append(property);
|
||||
|
|
|
@ -848,7 +848,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
if (parameters.Length > 0)
|
||||
{
|
||||
parameters.Append(",");
|
||||
parameters.Append(',');
|
||||
}
|
||||
|
||||
parameters.Append(string.Format(CultureInfo.CurrentUICulture, @"'{0}' = {1}", key, parameterList[key]));
|
||||
|
|
|
@ -379,8 +379,8 @@ namespace Microsoft.PowerShell.Commands
|
|||
private const string SelectCloser = "</Select>";
|
||||
private const string suppressOpener = "<Suppress>*";
|
||||
private const string suppressCloser = "</Suppress>";
|
||||
private const string propOpen = "[";
|
||||
private const string propClose = "]";
|
||||
private const char propOpen = '[';
|
||||
private const char propClose = ']';
|
||||
private const string filePrefix = "file://";
|
||||
private const string NamedDataTemplate = "((EventData[Data[@Name='{0}']='{1}']) or (UserData/*/{0}='{1}'))";
|
||||
private const string DataTemplate = "(EventData/Data='{0}')";
|
||||
|
@ -1353,21 +1353,21 @@ namespace Microsoft.PowerShell.Commands
|
|||
Array idsArray = value as Array;
|
||||
if (idsArray != null)
|
||||
{
|
||||
ret.Append("(");
|
||||
ret.Append('(');
|
||||
for (int i = 0; i < idsArray.Length; i++)
|
||||
{
|
||||
ret.Append(SystemEventIDTemplate).Append(idsArray.GetValue(i).ToString()).Append(")");
|
||||
ret.Append(SystemEventIDTemplate).Append(idsArray.GetValue(i).ToString()).Append(')');
|
||||
if (i < (idsArray.Length - 1))
|
||||
{
|
||||
ret.Append(" or ");
|
||||
}
|
||||
}
|
||||
|
||||
ret.Append(")");
|
||||
ret.Append(')');
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.Append(SystemEventIDTemplate).Append(value).Append(")");
|
||||
ret.Append(SystemEventIDTemplate).Append(value).Append(')');
|
||||
}
|
||||
|
||||
return ret.ToString();
|
||||
|
@ -1383,21 +1383,21 @@ namespace Microsoft.PowerShell.Commands
|
|||
Array levelsArray = value as Array;
|
||||
if (levelsArray != null)
|
||||
{
|
||||
ret.Append("(");
|
||||
ret.Append('(');
|
||||
for (int i = 0; i < levelsArray.Length; i++)
|
||||
{
|
||||
ret.Append(SystemLevelTemplate).Append(levelsArray.GetValue(i).ToString()).Append(")");
|
||||
ret.Append(SystemLevelTemplate).Append(levelsArray.GetValue(i).ToString()).Append(')');
|
||||
if (i < (levelsArray.Length - 1))
|
||||
{
|
||||
ret.Append(" or ");
|
||||
}
|
||||
}
|
||||
|
||||
ret.Append(")");
|
||||
ret.Append(')');
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.Append(SystemLevelTemplate).Append(value).Append(")");
|
||||
ret.Append(SystemLevelTemplate).Append(value).Append(')');
|
||||
}
|
||||
|
||||
return ret.ToString();
|
||||
|
@ -1571,7 +1571,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
Array dataArray = value as Array;
|
||||
if (dataArray != null)
|
||||
{
|
||||
ret.Append("(");
|
||||
ret.Append('(');
|
||||
for (int i = 0; i < dataArray.Length; i++)
|
||||
{
|
||||
ret.AppendFormat(CultureInfo.InvariantCulture, DataTemplate, dataArray.GetValue(i).ToString());
|
||||
|
@ -1581,7 +1581,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
}
|
||||
|
||||
ret.Append(")");
|
||||
ret.Append(')');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1602,7 +1602,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
Array dataArray = value as Array;
|
||||
if (dataArray != null)
|
||||
{
|
||||
ret.Append("(");
|
||||
ret.Append('(');
|
||||
for (int i = 0; i < dataArray.Length; i++)
|
||||
{
|
||||
ret.AppendFormat(CultureInfo.InvariantCulture,
|
||||
|
@ -1614,7 +1614,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
}
|
||||
|
||||
ret.Append(")");
|
||||
ret.Append(')');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1920,14 +1920,14 @@ namespace Microsoft.PowerShell.Commands
|
|||
StringBuilder predicate = new StringBuilder("System/Provider[");
|
||||
for (int i = 0; i < providers.Count; i++)
|
||||
{
|
||||
predicate.Append("@Name='").Append(providers[i]).Append("'");
|
||||
predicate.Append("@Name='").Append(providers[i]).Append('\'');
|
||||
if (i < (providers.Count - 1))
|
||||
{
|
||||
predicate.Append(" or ");
|
||||
}
|
||||
}
|
||||
|
||||
predicate.Append("]");
|
||||
predicate.Append(']');
|
||||
|
||||
return predicate.ToString();
|
||||
}
|
||||
|
@ -1964,14 +1964,14 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
for (int i = 0; i < uniqueProviderNames.Count; i++)
|
||||
{
|
||||
predicate.Append("@Name='").Append(uniqueProviderNames[i]).Append("'");
|
||||
predicate.Append("@Name='").Append(uniqueProviderNames[i]).Append('\'');
|
||||
if (i < uniqueProviderNames.Count - 1)
|
||||
{
|
||||
predicate.Append(" or ");
|
||||
}
|
||||
}
|
||||
|
||||
predicate.Append("]");
|
||||
predicate.Append(']');
|
||||
|
||||
return predicate.ToString();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
var wqlQueryBuilder = new StringBuilder();
|
||||
wqlQueryBuilder.Append("SELECT * FROM ");
|
||||
wqlQueryBuilder.Append(this.JobContext.ClassName);
|
||||
wqlQueryBuilder.Append(" ");
|
||||
wqlQueryBuilder.Append(' ');
|
||||
wqlQueryBuilder.Append(wqlCondition);
|
||||
_wqlQuery = wqlQueryBuilder.ToString();
|
||||
|
||||
|
|
|
@ -97,14 +97,14 @@ namespace Microsoft.PowerShell.Commands
|
|||
{
|
||||
queryString.Append("HotFixID= '");
|
||||
queryString.Append(Id[i].Replace("'", "\\'"));
|
||||
queryString.Append("'");
|
||||
queryString.Append('\'');
|
||||
if (i < Id.Length - 1)
|
||||
{
|
||||
queryString.Append(" Or ");
|
||||
}
|
||||
}
|
||||
|
||||
queryString.Append(")");
|
||||
queryString.Append(')');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -561,7 +561,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
{
|
||||
COLTag.Append(" width = \"");
|
||||
COLTag.Append(width);
|
||||
COLTag.Append("\"");
|
||||
COLTag.Append('"');
|
||||
}
|
||||
|
||||
string alignment = p.GetEntry(ConvertHTMLParameterDefinitionKeys.AlignmentEntryKey) as string;
|
||||
|
@ -569,7 +569,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
{
|
||||
COLTag.Append(" align = \"");
|
||||
COLTag.Append(alignment);
|
||||
COLTag.Append("\"");
|
||||
COLTag.Append('"');
|
||||
}
|
||||
|
||||
COLTag.Append("/>");
|
||||
|
@ -593,7 +593,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
// for writing the property name
|
||||
WritePropertyName(Listtag, p);
|
||||
Listtag.Append(":");
|
||||
Listtag.Append(':');
|
||||
Listtag.Append("</td>");
|
||||
|
||||
// for writing the property value
|
||||
|
|
|
@ -480,7 +480,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
break;
|
||||
|
||||
case 'n':
|
||||
sb.Append("\n");
|
||||
sb.Append('\n');
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
|
@ -508,7 +508,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
break;
|
||||
|
||||
case 't':
|
||||
sb.Append("\t");
|
||||
sb.Append('\t');
|
||||
break;
|
||||
|
||||
case 'U':
|
||||
|
|
|
@ -149,7 +149,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
{
|
||||
if (propValuePropertyValue is ICollection propertyValueItems)
|
||||
{
|
||||
sb.Append("{");
|
||||
sb.Append('{');
|
||||
var length = sb.Length;
|
||||
|
||||
foreach (object item in propertyValueItems)
|
||||
|
|
|
@ -2316,7 +2316,7 @@ function Get-PSImplicitRemotingSessionOption
|
|||
result.Append("-ApplicationArguments $(");
|
||||
result.Append("& $script:ImportCliXml -Path $(");
|
||||
result.Append("& $script:JoinPath -Path $PSScriptRoot -ChildPath ApplicationArguments.xml");
|
||||
result.Append(")");
|
||||
result.Append(')');
|
||||
result.Append(") ");
|
||||
}
|
||||
|
||||
|
@ -2953,7 +2953,7 @@ function Get-PSImplicitRemotingClientSideParameters
|
|||
}
|
||||
|
||||
arrayString.Insert(0, "@(");
|
||||
arrayString.Append(")");
|
||||
arrayString.Append(')');
|
||||
|
||||
return arrayString.ToString();
|
||||
}
|
||||
|
|
|
@ -782,7 +782,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
{
|
||||
if (0 < bodyBuilder.Length)
|
||||
{
|
||||
bodyBuilder.Append("&");
|
||||
bodyBuilder.Append('&');
|
||||
}
|
||||
|
||||
object value = content[key];
|
||||
|
|
|
@ -2523,7 +2523,7 @@ namespace Microsoft.PowerShell
|
|||
if (inBlockMode)
|
||||
{
|
||||
s_tracer.WriteLine("adding line to block");
|
||||
inputBlock.Append("\n");
|
||||
inputBlock.Append('\n');
|
||||
inputBlock.Append(line);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ namespace Microsoft.PowerShell
|
|||
|
||||
StringBuilder fieldPromptList = new StringBuilder(fieldPrompt);
|
||||
// fieldPromptList = fieldPrompt + "[i] :"
|
||||
fieldPromptList.Append("[");
|
||||
fieldPromptList.Append('[');
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
|
|
@ -281,7 +281,7 @@ namespace System.Diagnostics.Eventing
|
|||
StringBuilder failMessage = new StringBuilder(message);
|
||||
if (detailMessage != null)
|
||||
{
|
||||
failMessage.Append(" ");
|
||||
failMessage.Append(' ');
|
||||
failMessage.Append(detailMessage);
|
||||
}
|
||||
|
||||
|
|
|
@ -2328,7 +2328,7 @@ namespace Microsoft.WSMan.Management
|
|||
if (mshObject != null)
|
||||
{
|
||||
types.Append(mshObject.ImmediateBaseObject.GetType().FullName);
|
||||
types.Append("#");
|
||||
types.Append('#');
|
||||
types.Append(ExtendedTypeName);
|
||||
mshObject.TypeNames.Insert(0, types.ToString());
|
||||
}
|
||||
|
@ -2426,16 +2426,16 @@ namespace Microsoft.WSMan.Management
|
|||
sbvalues.Append(key);
|
||||
if (value[key] == null)
|
||||
{
|
||||
sbvalues.Append(" ");
|
||||
sbvalues.Append(' ');
|
||||
sbvalues.Append(WSManStringLiterals.ATTR_NIL);
|
||||
nilns = " " + WSManStringLiterals.NS_XSI;
|
||||
}
|
||||
|
||||
sbvalues.Append(">");
|
||||
sbvalues.Append('>');
|
||||
sbvalues.Append(EscapeValuesForXML(((Hashtable)value)[key].ToString()));
|
||||
sbvalues.Append("</p:");
|
||||
sbvalues.Append(key);
|
||||
sbvalues.Append(">");
|
||||
sbvalues.Append('>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2942,17 +2942,17 @@ namespace Microsoft.WSMan.Management
|
|||
{
|
||||
if (uri.Contains("Config/Listener"))
|
||||
{
|
||||
sburi.Append("?");
|
||||
sburi.Append('?');
|
||||
sburi.Append(GetFilterString(cmdlinevalues, PKeyListener));
|
||||
}
|
||||
else if (uri.Contains("Config/Service/certmapping"))
|
||||
{
|
||||
sburi.Append("?");
|
||||
sburi.Append('?');
|
||||
sburi.Append(GetFilterString(cmdlinevalues, PKeyCertMapping));
|
||||
}
|
||||
else if (uri.Contains("Config/Plugin"))
|
||||
{
|
||||
sburi.Append("?");
|
||||
sburi.Append('?');
|
||||
sburi.Append(GetFilterString(cmdlinevalues, PKeyPlugin));
|
||||
}
|
||||
}
|
||||
|
@ -2968,9 +2968,9 @@ namespace Microsoft.WSMan.Management
|
|||
if (cmdlinevalues.Contains(key))
|
||||
{
|
||||
filter.Append(key);
|
||||
filter.Append("=");
|
||||
filter.Append('=');
|
||||
filter.Append(cmdlinevalues[key].ToString());
|
||||
filter.Append("+");
|
||||
filter.Append('+');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3102,7 +3102,7 @@ namespace Microsoft.WSMan.Management
|
|||
if (mshObject != null)
|
||||
{
|
||||
types.Append(mshObject.ImmediateBaseObject.GetType().FullName);
|
||||
types.Append("#");
|
||||
types.Append('#');
|
||||
types.Append(ExtendedTypeName);
|
||||
mshObject.TypeNames.Insert(0, types.ToString());
|
||||
}
|
||||
|
|
|
@ -871,9 +871,9 @@ namespace Microsoft.WSMan.Management
|
|||
if (entry.Key != null && entry.Value != null)
|
||||
{
|
||||
filter.Append(entry.Key.ToString());
|
||||
filter.Append("=");
|
||||
filter.Append('=');
|
||||
filter.Append(entry.Value.ToString());
|
||||
filter.Append("+");
|
||||
filter.Append('+');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -917,7 +917,7 @@ namespace Microsoft.WSMan.Management
|
|||
{
|
||||
StringBuilder sburi = new StringBuilder();
|
||||
sburi.Append(uri);
|
||||
sburi.Append("?");
|
||||
sburi.Append('?');
|
||||
|
||||
if (operation.Equals("remove", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
|
|
@ -1034,7 +1034,7 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
|||
foreach (var c in classes)
|
||||
{
|
||||
sb.Append(c.CimSystemProperties.ClassName);
|
||||
sb.Append(",");
|
||||
sb.Append(',');
|
||||
}
|
||||
|
||||
s_tracer.WriteLine("DSC ClassCache: loading file '{0}' added the following classes to the cache: {1}", path, sb.ToString());
|
||||
|
@ -2911,7 +2911,7 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
|||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
sb.Append("[");
|
||||
sb.Append('[');
|
||||
bool needComma = false;
|
||||
foreach (var attr in customAttributes)
|
||||
{
|
||||
|
@ -2954,9 +2954,9 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
|||
valueMapComma = true;
|
||||
}
|
||||
|
||||
sb.Append("}");
|
||||
sb.Append('}');
|
||||
sb.Append(sbValues);
|
||||
sb.Append("}");
|
||||
sb.Append('}');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2985,14 +2985,14 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
|||
needComma = true;
|
||||
}
|
||||
|
||||
sb.Append("}");
|
||||
sb.Append('}');
|
||||
}
|
||||
else if (embeddedInstanceType != null)
|
||||
{
|
||||
sb.AppendFormat(CultureInfo.InvariantCulture, "{0}EmbeddedInstance(\"{1}\")", needComma ? ", " : string.Empty, embeddedInstanceType);
|
||||
}
|
||||
|
||||
sb.Append("]");
|
||||
sb.Append(']');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
@ -3645,7 +3645,7 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
|||
}
|
||||
}
|
||||
|
||||
usageString.Append("}");
|
||||
usageString.Append('}');
|
||||
|
||||
return usageString.ToString();
|
||||
}
|
||||
|
@ -3691,10 +3691,10 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
|||
// We prepend optional property with "[" so close out it here. This way it is shown with [ ] to indication optional
|
||||
if (isOptionalProperty)
|
||||
{
|
||||
formattedTypeString.Append("]");
|
||||
formattedTypeString.Append(']');
|
||||
}
|
||||
|
||||
formattedTypeString.Append("\n");
|
||||
formattedTypeString.Append('\n');
|
||||
|
||||
return formattedTypeString;
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
|||
if (e != null)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("{");
|
||||
sb.Append('{');
|
||||
|
||||
bool first = true;
|
||||
int enumCount = 0;
|
||||
|
@ -283,7 +283,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
|||
}
|
||||
}
|
||||
|
||||
sb.Append("}");
|
||||
sb.Append('}');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
|
|
@ -507,7 +507,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
|||
internal static string CatenateStringArray(string[] arr)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("{");
|
||||
sb.Append('{');
|
||||
for (int k = 0; k < arr.Length; k++)
|
||||
{
|
||||
if (k > 0)
|
||||
|
@ -518,7 +518,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
|||
sb.Append(arr[k]);
|
||||
}
|
||||
|
||||
sb.Append("}");
|
||||
sb.Append('}');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace System.Management.Automation
|
|||
StringBuilder firstType = new StringBuilder("System.__ComObject");
|
||||
firstType.Append("#{");
|
||||
firstType.Append(clsid);
|
||||
firstType.Append("}");
|
||||
firstType.Append('}');
|
||||
return firstType.ToString();
|
||||
}
|
||||
|
||||
|
|
|
@ -366,7 +366,7 @@ namespace System.Management.Automation
|
|||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.Append(this.GetDefinition());
|
||||
builder.Append(" ");
|
||||
builder.Append(' ');
|
||||
if (IsGettable)
|
||||
{
|
||||
builder.Append("{get} ");
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace System.Management.Automation
|
|||
}
|
||||
}
|
||||
|
||||
builder.Append(")");
|
||||
builder.Append(')');
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
|
|
@ -1471,7 +1471,7 @@ namespace System.Management.Automation
|
|||
{
|
||||
StringBuilder sb = new StringBuilder("[", 50);
|
||||
sb.Append(dynamicKeywordAst.Keyword.Keyword);
|
||||
sb.Append("]");
|
||||
sb.Append(']');
|
||||
sb.Append(dynamicKeywordAst.ElementName);
|
||||
var resource = sb.ToString();
|
||||
if (!existingValues.Contains(resource, StringComparer.OrdinalIgnoreCase) &&
|
||||
|
|
|
@ -2667,7 +2667,7 @@ namespace System.Management.Automation
|
|||
|
||||
StringBuilder tooltipText = new StringBuilder();
|
||||
tooltipText.Append(methodName);
|
||||
tooltipText.Append("(");
|
||||
tooltipText.Append('(');
|
||||
bool gotFirstParameter = false;
|
||||
foreach (var methodParameter in methodDeclaration.Parameters)
|
||||
{
|
||||
|
@ -2688,7 +2688,7 @@ namespace System.Management.Automation
|
|||
}
|
||||
|
||||
tooltipText.Append(CimInstanceAdapter.CimTypeToTypeNameDisplayString(methodParameter.CimType));
|
||||
tooltipText.Append(" ");
|
||||
tooltipText.Append(' ');
|
||||
tooltipText.Append(methodParameter.Name);
|
||||
|
||||
if (outParameter)
|
||||
|
@ -2697,7 +2697,7 @@ namespace System.Management.Automation
|
|||
}
|
||||
}
|
||||
|
||||
tooltipText.Append(")");
|
||||
tooltipText.Append(')');
|
||||
|
||||
localResults.Add(new CompletionResult(methodName, methodName, CompletionResultType.Method, tooltipText.ToString()));
|
||||
}
|
||||
|
|
|
@ -981,7 +981,7 @@ namespace System.Management.Automation
|
|||
{
|
||||
if (!IsPSTypeName(m))
|
||||
{
|
||||
builder.Append(m.Name).Append(":");
|
||||
builder.Append(m.Name).Append(':');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -897,7 +897,7 @@ end
|
|||
decl.Append(separator);
|
||||
decl.Append("DefaultParameterSetName='");
|
||||
decl.Append(CodeGeneration.EscapeSingleQuotedStringContent(_defaultParameterSetName));
|
||||
decl.Append("'");
|
||||
decl.Append('\'');
|
||||
separator = ", ";
|
||||
}
|
||||
|
||||
|
@ -909,7 +909,7 @@ end
|
|||
decl.Append(separator);
|
||||
decl.Append("ConfirmImpact='");
|
||||
decl.Append(ConfirmImpact);
|
||||
decl.Append("'");
|
||||
decl.Append('\'');
|
||||
}
|
||||
|
||||
if (SupportsPaging)
|
||||
|
@ -938,7 +938,7 @@ end
|
|||
decl.Append(separator);
|
||||
decl.Append("HelpUri='");
|
||||
decl.Append(CodeGeneration.EscapeSingleQuotedStringContent(HelpUri));
|
||||
decl.Append("'");
|
||||
decl.Append('\'');
|
||||
separator = ", ";
|
||||
}
|
||||
|
||||
|
@ -947,7 +947,7 @@ end
|
|||
decl.Append(separator);
|
||||
decl.Append("RemotingCapability='");
|
||||
decl.Append(_remotingCapability);
|
||||
decl.Append("'");
|
||||
decl.Append('\'');
|
||||
separator = ", ";
|
||||
}
|
||||
|
||||
|
|
|
@ -2722,7 +2722,7 @@ namespace System.Management.Automation
|
|||
|
||||
definition.Append(" {");
|
||||
definition.Append(extraDefinition);
|
||||
definition.Append("}");
|
||||
definition.Append('}');
|
||||
definitionArray.Add(definition.ToString());
|
||||
}
|
||||
|
||||
|
@ -3995,7 +3995,7 @@ namespace System.Management.Automation
|
|||
}
|
||||
|
||||
returnValue.Append(PropertyType(property, forDisplay: true));
|
||||
returnValue.Append(" ");
|
||||
returnValue.Append(' ');
|
||||
returnValue.Append(property.Name);
|
||||
returnValue.Append(" {");
|
||||
if (PropertyIsGettable(property))
|
||||
|
@ -4008,7 +4008,7 @@ namespace System.Management.Automation
|
|||
returnValue.Append("set;");
|
||||
}
|
||||
|
||||
returnValue.Append("}");
|
||||
returnValue.Append('}');
|
||||
return returnValue.ToString();
|
||||
}
|
||||
|
||||
|
@ -4415,7 +4415,7 @@ namespace System.Management.Automation
|
|||
if (method != null)
|
||||
{
|
||||
builder.Append(ToStringCodeMethods.Type(method.ReturnType));
|
||||
builder.Append(" ");
|
||||
builder.Append(' ');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4423,20 +4423,20 @@ namespace System.Management.Automation
|
|||
if (ctorInfo != null)
|
||||
{
|
||||
builder.Append(ToStringCodeMethods.Type(ctorInfo.DeclaringType));
|
||||
builder.Append(" ");
|
||||
builder.Append(' ');
|
||||
}
|
||||
}
|
||||
|
||||
if (methodEntry.DeclaringType.IsInterface)
|
||||
{
|
||||
builder.Append(ToStringCodeMethods.Type(methodEntry.DeclaringType, dropNamespaces: true));
|
||||
builder.Append(".");
|
||||
builder.Append('.');
|
||||
}
|
||||
|
||||
builder.Append(memberName ?? methodEntry.Name);
|
||||
if (methodEntry.IsGenericMethodDefinition)
|
||||
{
|
||||
builder.Append("[");
|
||||
builder.Append('[');
|
||||
|
||||
Type[] genericArgs = methodEntry.GetGenericArguments();
|
||||
for (int i = 0; i < genericArgs.Length; i++)
|
||||
|
@ -4446,10 +4446,10 @@ namespace System.Management.Automation
|
|||
builder.Append(ToStringCodeMethods.Type(genericArgs[i]));
|
||||
}
|
||||
|
||||
builder.Append("]");
|
||||
builder.Append(']');
|
||||
}
|
||||
|
||||
builder.Append("(");
|
||||
builder.Append('(');
|
||||
System.Reflection.ParameterInfo[] parameters = methodEntry.GetParameters();
|
||||
int parametersLength = parameters.Length - parametersToIgnore;
|
||||
if (parametersLength > 0)
|
||||
|
@ -4478,7 +4478,7 @@ namespace System.Management.Automation
|
|||
}
|
||||
|
||||
builder.Append(ToStringCodeMethods.Type(parameterType));
|
||||
builder.Append(" ");
|
||||
builder.Append(' ');
|
||||
builder.Append(parameter.Name);
|
||||
builder.Append(", ");
|
||||
}
|
||||
|
@ -4486,7 +4486,7 @@ namespace System.Management.Automation
|
|||
builder.Remove(builder.Length - 2, 2);
|
||||
}
|
||||
|
||||
builder.Append(")");
|
||||
builder.Append(')');
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
@ -5256,9 +5256,9 @@ namespace System.Management.Automation
|
|||
if (firstType == null)
|
||||
{
|
||||
firstType = new StringBuilder(baseType);
|
||||
firstType.Append("#");
|
||||
firstType.Append('#');
|
||||
firstType.Append(node.NamespaceURI);
|
||||
firstType.Append("#");
|
||||
firstType.Append('#');
|
||||
firstType.Append(node.LocalName);
|
||||
yield return firstType.ToString();
|
||||
}
|
||||
|
|
|
@ -83,11 +83,11 @@ namespace System.Management.Automation
|
|||
StringBuilder type = new StringBuilder(200);
|
||||
// give the typename based on NameSpace and Class
|
||||
type.Append(dotnetBaseType);
|
||||
type.Append("#");
|
||||
type.Append('#');
|
||||
if (shouldIncludeNamespace)
|
||||
{
|
||||
type.Append(managementObj.SystemProperties["__NAMESPACE"].Value);
|
||||
type.Append("\\");
|
||||
type.Append('\\');
|
||||
}
|
||||
|
||||
type.Append(managementObj.SystemProperties["__CLASS"].Value);
|
||||
|
@ -112,11 +112,11 @@ namespace System.Management.Automation
|
|||
{
|
||||
type.Clear();
|
||||
type.Append(dotnetBaseType);
|
||||
type.Append("#");
|
||||
type.Append('#');
|
||||
if (shouldIncludeNamespace)
|
||||
{
|
||||
type.Append(managementObj.SystemProperties["__NAMESPACE"].Value);
|
||||
type.Append("\\");
|
||||
type.Append('\\');
|
||||
}
|
||||
|
||||
type.Append(t);
|
||||
|
@ -412,7 +412,7 @@ namespace System.Management.Automation
|
|||
// }
|
||||
|
||||
returnValue.Append(PropertyType(property, forDisplay: true));
|
||||
returnValue.Append(" ");
|
||||
returnValue.Append(' ');
|
||||
returnValue.Append(property.Name);
|
||||
returnValue.Append(" {");
|
||||
if (PropertyIsGettable(property))
|
||||
|
@ -425,7 +425,7 @@ namespace System.Management.Automation
|
|||
returnValue.Append("set;");
|
||||
}
|
||||
|
||||
returnValue.Append("}");
|
||||
returnValue.Append('}');
|
||||
return returnValue.ToString();
|
||||
}
|
||||
|
||||
|
@ -856,7 +856,7 @@ namespace System.Management.Automation
|
|||
}
|
||||
|
||||
inParameterString.Append(typeName);
|
||||
inParameterString.Append(" ");
|
||||
inParameterString.Append(' ');
|
||||
inParameterString.Append(parameter.Name);
|
||||
inParameterString.Append(", ");
|
||||
}
|
||||
|
@ -872,9 +872,9 @@ namespace System.Management.Automation
|
|||
|
||||
builder.Append("System.Management.ManagementBaseObject ");
|
||||
builder.Append(mData.Name);
|
||||
builder.Append("(");
|
||||
builder.Append('(');
|
||||
builder.Append(inParameterString.ToString());
|
||||
builder.Append(")");
|
||||
builder.Append(')');
|
||||
|
||||
string returnValue = builder.ToString();
|
||||
tracer.WriteLine("Definition constructed: {0}", returnValue);
|
||||
|
|
|
@ -591,9 +591,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
{
|
||||
if (badKeys.Length > 0)
|
||||
badKeys.Append(", ");
|
||||
badKeys.Append("'");
|
||||
badKeys.Append('\'');
|
||||
badKeys.Append(s);
|
||||
badKeys.Append("'");
|
||||
badKeys.Append('\'');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -630,7 +630,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
validMembersString.Append(validMembers[i]);
|
||||
}
|
||||
|
||||
validMembersString.Append("'");
|
||||
validMembersString.Append('\'');
|
||||
message = StringUtil.Format(Modules.InvalidModuleManifestMember, moduleManifestPath, validMembersString, badKeys);
|
||||
InvalidOperationException ioe = new InvalidOperationException(message);
|
||||
ErrorRecord er = new ErrorRecord(ioe, "Modules_InvalidManifestMember",
|
||||
|
@ -4214,9 +4214,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
while (currentCulture != null && !string.IsNullOrEmpty(currentCulture.Name))
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder(dir);
|
||||
stringBuilder.Append("\\");
|
||||
stringBuilder.Append('\\');
|
||||
stringBuilder.Append(currentCulture.Name);
|
||||
stringBuilder.Append("\\");
|
||||
stringBuilder.Append('\\');
|
||||
stringBuilder.Append(file);
|
||||
|
||||
string filePath = stringBuilder.ToString();
|
||||
|
|
|
@ -123,9 +123,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
badKeys.Append(", ");
|
||||
}
|
||||
|
||||
badKeys.Append("'");
|
||||
badKeys.Append('\'');
|
||||
badKeys.Append(entry.Key.ToString());
|
||||
badKeys.Append("'");
|
||||
badKeys.Append('\'');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
var moduleSpecBuilder = new StringBuilder();
|
||||
|
||||
moduleSpecBuilder.Append("@{ ModuleName = '").Append(Name).Append("'");
|
||||
moduleSpecBuilder.Append("@{ ModuleName = '").Append(Name).Append('\'');
|
||||
|
||||
if (Guid != null)
|
||||
{
|
||||
|
@ -206,18 +206,18 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
if (RequiredVersion != null)
|
||||
{
|
||||
moduleSpecBuilder.Append("; RequiredVersion = '").Append(RequiredVersion).Append("'");
|
||||
moduleSpecBuilder.Append("; RequiredVersion = '").Append(RequiredVersion).Append('\'');
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Version != null)
|
||||
{
|
||||
moduleSpecBuilder.Append("; ModuleVersion = '").Append(Version).Append("'");
|
||||
moduleSpecBuilder.Append("; ModuleVersion = '").Append(Version).Append('\'');
|
||||
}
|
||||
|
||||
if (MaximumVersion != null)
|
||||
{
|
||||
moduleSpecBuilder.Append("; MaximumVersion = '").Append(MaximumVersion).Append("'");
|
||||
moduleSpecBuilder.Append("; MaximumVersion = '").Append(MaximumVersion).Append('\'');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -717,12 +717,12 @@ namespace Microsoft.PowerShell.Commands
|
|||
result.Append("; ");
|
||||
}
|
||||
|
||||
result.Append("}");
|
||||
result.Append('}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result.Append(")");
|
||||
result.Append(')');
|
||||
return result.ToString();
|
||||
}
|
||||
|
||||
|
@ -1094,7 +1094,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
BuildModuleManifest(result, nameof(DefaultCommandPrefix), Modules.DefaultCommandPrefix, !string.IsNullOrEmpty(_defaultCommandPrefix), () => QuoteName(_defaultCommandPrefix), streamWriter);
|
||||
|
||||
result.Append("}");
|
||||
result.Append('}');
|
||||
result.Append(streamWriter.NewLine);
|
||||
result.Append(streamWriter.NewLine);
|
||||
string strResult = result.ToString();
|
||||
|
|
|
@ -356,9 +356,9 @@ namespace System.Management.Automation
|
|||
returnValue.Append(" = ");
|
||||
if (ConversionType != null)
|
||||
{
|
||||
returnValue.Append("(");
|
||||
returnValue.Append('(');
|
||||
returnValue.Append(ConversionType);
|
||||
returnValue.Append(")");
|
||||
returnValue.Append(')');
|
||||
}
|
||||
|
||||
returnValue.Append(ReferencedMemberName);
|
||||
|
@ -616,24 +616,24 @@ namespace System.Management.Automation
|
|||
{
|
||||
StringBuilder returnValue = new StringBuilder();
|
||||
returnValue.Append(this.TypeNameOfValue);
|
||||
returnValue.Append(" ");
|
||||
returnValue.Append(' ');
|
||||
returnValue.Append(this.Name);
|
||||
returnValue.Append("{");
|
||||
returnValue.Append('{');
|
||||
if (this.IsGettable)
|
||||
{
|
||||
returnValue.Append("get=");
|
||||
returnValue.Append(GetterCodeReference.Name);
|
||||
returnValue.Append(";");
|
||||
returnValue.Append(';');
|
||||
}
|
||||
|
||||
if (this.IsSettable)
|
||||
{
|
||||
returnValue.Append("set=");
|
||||
returnValue.Append(SetterCodeReference.Name);
|
||||
returnValue.Append(";");
|
||||
returnValue.Append(';');
|
||||
}
|
||||
|
||||
returnValue.Append("}");
|
||||
returnValue.Append('}');
|
||||
return returnValue.ToString();
|
||||
}
|
||||
|
||||
|
@ -1274,9 +1274,9 @@ namespace System.Management.Automation
|
|||
StringBuilder returnValue = new StringBuilder();
|
||||
|
||||
returnValue.Append(GetDisplayTypeNameOfValue(this.Value));
|
||||
returnValue.Append(" ");
|
||||
returnValue.Append(' ');
|
||||
returnValue.Append(this.Name);
|
||||
returnValue.Append("=");
|
||||
returnValue.Append('=');
|
||||
returnValue.Append(this.noteValue == null ? "null" : this.noteValue.ToString());
|
||||
return returnValue.ToString();
|
||||
}
|
||||
|
@ -1421,9 +1421,9 @@ namespace System.Management.Automation
|
|||
{
|
||||
StringBuilder returnValue = new StringBuilder();
|
||||
returnValue.Append(GetDisplayTypeNameOfValue(_variable.Value));
|
||||
returnValue.Append(" ");
|
||||
returnValue.Append(' ');
|
||||
returnValue.Append(_variable.Name);
|
||||
returnValue.Append("=");
|
||||
returnValue.Append('=');
|
||||
returnValue.Append(_variable.Value ?? "null");
|
||||
return returnValue.ToString();
|
||||
}
|
||||
|
@ -1541,24 +1541,24 @@ namespace System.Management.Automation
|
|||
{
|
||||
StringBuilder returnValue = new StringBuilder();
|
||||
returnValue.Append(this.TypeNameOfValue);
|
||||
returnValue.Append(" ");
|
||||
returnValue.Append(' ');
|
||||
returnValue.Append(this.Name);
|
||||
returnValue.Append(" {");
|
||||
if (this.IsGettable)
|
||||
{
|
||||
returnValue.Append("get=");
|
||||
returnValue.Append(this.GetterScript.ToString());
|
||||
returnValue.Append(";");
|
||||
returnValue.Append(';');
|
||||
}
|
||||
|
||||
if (this.IsSettable)
|
||||
{
|
||||
returnValue.Append("set=");
|
||||
returnValue.Append(this.SetterScript.ToString());
|
||||
returnValue.Append(";");
|
||||
returnValue.Append(';');
|
||||
}
|
||||
|
||||
returnValue.Append("}");
|
||||
returnValue.Append('}');
|
||||
return returnValue.ToString();
|
||||
}
|
||||
|
||||
|
@ -2283,7 +2283,7 @@ namespace System.Management.Automation
|
|||
{
|
||||
StringBuilder returnValue = new StringBuilder();
|
||||
returnValue.Append(this.TypeNameOfValue);
|
||||
returnValue.Append(" ");
|
||||
returnValue.Append(' ');
|
||||
returnValue.Append(this.Name);
|
||||
returnValue.Append("();");
|
||||
return returnValue.ToString();
|
||||
|
@ -3038,7 +3038,7 @@ namespace System.Management.Automation
|
|||
}
|
||||
|
||||
returnValue.Insert(0, this.Name);
|
||||
returnValue.Append("}");
|
||||
returnValue.Append('}');
|
||||
return returnValue.ToString();
|
||||
}
|
||||
|
||||
|
@ -3441,7 +3441,7 @@ namespace System.Management.Automation
|
|||
returnValue.Remove(returnValue.Length - 2, 2);
|
||||
}
|
||||
|
||||
returnValue.Append("}");
|
||||
returnValue.Append('}');
|
||||
return returnValue.ToString();
|
||||
}
|
||||
|
||||
|
@ -3554,7 +3554,7 @@ namespace System.Management.Automation
|
|||
StringBuilder eventDefinition = new StringBuilder();
|
||||
eventDefinition.Append(this.baseEvent.ToString());
|
||||
|
||||
eventDefinition.Append("(");
|
||||
eventDefinition.Append('(');
|
||||
|
||||
int loopCounter = 0;
|
||||
foreach (ParameterInfo parameter in baseEvent.EventHandlerType.GetMethod("Invoke").GetParameters())
|
||||
|
@ -3567,7 +3567,7 @@ namespace System.Management.Automation
|
|||
loopCounter++;
|
||||
}
|
||||
|
||||
eventDefinition.Append(")");
|
||||
eventDefinition.Append(')');
|
||||
|
||||
return eventDefinition.ToString();
|
||||
}
|
||||
|
|
|
@ -1175,7 +1175,7 @@ namespace System.Management.Automation
|
|||
|
||||
isFirst = false;
|
||||
returnValue.Append(property.Name);
|
||||
returnValue.Append("=");
|
||||
returnValue.Append('=');
|
||||
|
||||
// Don't evaluate script properties during a ToString() operation.
|
||||
var propertyValue = property is PSScriptProperty ? property.GetType().FullName : property.Value;
|
||||
|
@ -1188,7 +1188,7 @@ namespace System.Management.Automation
|
|||
return string.Empty;
|
||||
}
|
||||
|
||||
returnValue.Append("}");
|
||||
returnValue.Append('}');
|
||||
return returnValue.ToString();
|
||||
}
|
||||
|
||||
|
@ -2538,13 +2538,13 @@ namespace Microsoft.PowerShell
|
|||
{
|
||||
string elementDefinition = Type(type.GetElementType(), dropNamespaces);
|
||||
var sb = new StringBuilder(elementDefinition, elementDefinition.Length + 10);
|
||||
sb.Append("[");
|
||||
sb.Append('[');
|
||||
for (int i = 0; i < type.GetArrayRank() - 1; ++i)
|
||||
{
|
||||
sb.Append(",");
|
||||
sb.Append(',');
|
||||
}
|
||||
|
||||
sb.Append("]");
|
||||
sb.Append(']');
|
||||
result = sb.ToString();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -308,9 +308,9 @@ namespace System.Management.Automation
|
|||
// If the path contains spaces, then add quotes around it.
|
||||
if (NeedQuotes(expandedPath))
|
||||
{
|
||||
_arguments.Append("\"");
|
||||
_arguments.Append('"');
|
||||
_arguments.Append(expandedPath);
|
||||
_arguments.Append("\"");
|
||||
_arguments.Append('"');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -802,12 +802,12 @@ namespace System.Management.Automation
|
|||
|
||||
if (!string.IsNullOrEmpty(PreReleaseLabel))
|
||||
{
|
||||
result.Append("-").Append(PreReleaseLabel);
|
||||
result.Append('-').Append(PreReleaseLabel);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(BuildLabel))
|
||||
{
|
||||
result.Append("+").Append(BuildLabel);
|
||||
result.Append('+').Append(BuildLabel);
|
||||
}
|
||||
|
||||
versionString = result.ToString();
|
||||
|
|
|
@ -97,12 +97,12 @@ namespace System.Management.Automation
|
|||
{
|
||||
if (result.Length > 0)
|
||||
{
|
||||
result.Append(" ");
|
||||
result.Append(' ');
|
||||
}
|
||||
|
||||
result.Append("[");
|
||||
result.Append('[');
|
||||
result.Append(str);
|
||||
result.Append("]");
|
||||
result.Append(']');
|
||||
});
|
||||
|
||||
return result.ToString();
|
||||
|
@ -233,7 +233,7 @@ namespace System.Management.Automation
|
|||
if (result.Length > 0)
|
||||
{
|
||||
// Add a space between parameters
|
||||
result.Append(" ");
|
||||
result.Append(' ');
|
||||
}
|
||||
|
||||
if (parameter.ParameterType == typeof(SwitchParameter))
|
||||
|
|
|
@ -278,11 +278,11 @@ namespace System.Management.Automation
|
|||
string text = GetObjText(obj);
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
sb.Append("\n");
|
||||
sb.Append('\n');
|
||||
sb.Append(section);
|
||||
sb.Append("\n\n");
|
||||
sb.Append(text);
|
||||
sb.Append("\n");
|
||||
sb.Append('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -306,13 +306,13 @@ namespace System.Management.Automation
|
|||
}
|
||||
|
||||
sb.Append(text);
|
||||
sb.Append("\n");
|
||||
sb.Append('\n');
|
||||
}
|
||||
}
|
||||
|
||||
if (!first)
|
||||
{
|
||||
sb.Append("\n");
|
||||
sb.Append('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ namespace System.Management.Automation
|
|||
sb.Append(section);
|
||||
sb.Append("\n\n");
|
||||
sb.Append(GetObjText(name));
|
||||
sb.Append("\n");
|
||||
sb.Append('\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -338,7 +338,7 @@ namespace System.Management.Automation
|
|||
sb.Append(section);
|
||||
sb.Append("\n\n");
|
||||
sb.Append(GetObjText(uri));
|
||||
sb.Append("\n");
|
||||
sb.Append('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ namespace System.Management.Automation
|
|||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
sb.Append(text);
|
||||
sb.Append("\n");
|
||||
sb.Append('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -430,7 +430,7 @@ namespace System.Management.Automation
|
|||
PSObject[] remarks = GetProperty<PSObject[]>(ex, "remarks");
|
||||
if (remarks != null)
|
||||
{
|
||||
exsb.Append("\n");
|
||||
exsb.Append('\n');
|
||||
foreach (PSObject remark in remarks)
|
||||
{
|
||||
string remarkText = GetProperty<string>(remark, "text");
|
||||
|
|
|
@ -317,7 +317,7 @@ namespace System.Management.Automation
|
|||
|
||||
foreach (ProviderInfo matchingProvider in matchingProviders)
|
||||
{
|
||||
possibleMatches.Append(" ");
|
||||
possibleMatches.Append(' ');
|
||||
possibleMatches.Append(matchingProvider.FullName);
|
||||
}
|
||||
|
||||
|
|
|
@ -2271,7 +2271,7 @@ namespace System.Management.Automation.Language
|
|||
else
|
||||
argBuilder.Append(", ");
|
||||
|
||||
argBuilder.Append("$");
|
||||
argBuilder.Append('$');
|
||||
argBuilder.Append(varName);
|
||||
}
|
||||
|
||||
|
|
|
@ -3756,7 +3756,7 @@ namespace System.Management.Automation.Language
|
|||
separator = ", ";
|
||||
}
|
||||
|
||||
sb.Append(")");
|
||||
sb.Append(')');
|
||||
sb.Append(Environment.NewLine);
|
||||
|
||||
return sb.ToString();
|
||||
|
|
|
@ -4563,7 +4563,7 @@ namespace System.Management.Automation.Language
|
|||
if (PeekChar() == '=')
|
||||
{
|
||||
_tokenStart = _currentIndex;
|
||||
sb.Append("=");
|
||||
sb.Append('=');
|
||||
SkipChar();
|
||||
NewToken(TokenKind.Equals);
|
||||
ScanAssemblyNameSpecToken(sb);
|
||||
|
|
|
@ -2585,7 +2585,7 @@ namespace System.Management.Automation
|
|||
foreach (PSRemotingChildJob job in ChildJobs)
|
||||
{
|
||||
location.Append(job.Location);
|
||||
location.Append(",");
|
||||
location.Append(',');
|
||||
}
|
||||
|
||||
location.Remove(location.Length - 1, 1);
|
||||
|
|
|
@ -2055,7 +2055,7 @@ namespace System.Management.Automation
|
|||
|
||||
if (i < (ChildJobs.Count - 1))
|
||||
{
|
||||
sb.Append(",");
|
||||
sb.Append(',');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1105,7 +1105,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
SessionConfigurationUtils.CombineStringArray(_assembliesToLoad), streamWriter, isExample));
|
||||
}
|
||||
|
||||
result.Append("}");
|
||||
result.Append('}');
|
||||
|
||||
streamWriter.Write(result.ToString());
|
||||
}
|
||||
|
@ -1837,7 +1837,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
result.Append(SessionConfigurationUtils.ConfigFragment(ConfigFileConstants.AssembliesToLoad, RemotingErrorIdStrings.DISCAssembliesToLoadComment,
|
||||
SessionConfigurationUtils.CombineStringArray(_assembliesToLoad), streamWriter, isExample));
|
||||
|
||||
result.Append("}");
|
||||
result.Append('}');
|
||||
|
||||
streamWriter.Write(result.ToString());
|
||||
}
|
||||
|
|
|
@ -489,7 +489,7 @@ namespace System.Management.Automation.Remoting.Internal
|
|||
internal static string CreateInformationalMessage(Guid instanceId, string message)
|
||||
{
|
||||
var newMessage = new StringBuilder(instanceId.ToString());
|
||||
newMessage.Append(":");
|
||||
newMessage.Append(':');
|
||||
newMessage.Append(message);
|
||||
return newMessage.ToString();
|
||||
}
|
||||
|
|
|
@ -886,7 +886,7 @@ namespace System.Management.Automation.Help
|
|||
}
|
||||
}
|
||||
|
||||
sb.Append(")");
|
||||
sb.Append(')');
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
|
|
@ -799,7 +799,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
if (textElement.Contains(charactersThatNeedEscaping))
|
||||
{
|
||||
// This text element needs espacing
|
||||
result.Append("`");
|
||||
result.Append('`');
|
||||
}
|
||||
|
||||
result.Append(textElement);
|
||||
|
@ -848,7 +848,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
if (textElement.Contains(charactersThatNeedEscaping))
|
||||
{
|
||||
// This text element needs espacing
|
||||
result.Append("`");
|
||||
result.Append('`');
|
||||
}
|
||||
|
||||
result.Append(textElement);
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace System.Management.Automation.Runspaces
|
|||
{
|
||||
foreach (PSSnapInException e in PSSnapInExceptions)
|
||||
{
|
||||
sb.Append("\n");
|
||||
sb.Append('\n');
|
||||
sb.Append(e.Message);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1189,7 +1189,7 @@ namespace System.Management.Automation
|
|||
declaringType.Name,
|
||||
callingMethod.Name);
|
||||
|
||||
methodAndParameters.Append(")");
|
||||
methodAndParameters.Append(')');
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue