diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs
index ed21408c92f..6d51d972916 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs
@@ -2589,15 +2589,12 @@ private string GenerateConnectionStringForNewRunspace()
CodeGeneration.EscapeSingleQuotedStringContent(connectionInfo.AppName),
connectionInfo.UseDefaultWSManPort ?
string.Empty :
- string.Format(CultureInfo.InvariantCulture,
- "-Port {0} ", connectionInfo.Port),
+ string.Create(CultureInfo.InvariantCulture, $"-Port {connectionInfo.Port} "),
isSSLSpecified ? "-useSSL" : string.Empty);
}
else
{
- return string.Format(CultureInfo.InvariantCulture,
- "-connectionUri '{0}'",
- CodeGeneration.EscapeSingleQuotedStringContent(GetConnectionString()));
+ return string.Create(CultureInfo.InvariantCulture, $"-connectionUri '{CodeGeneration.EscapeSingleQuotedStringContent(GetConnectionString())}'");
}
}
diff --git a/src/Microsoft.WSMan.Management/CredSSP.cs b/src/Microsoft.WSMan.Management/CredSSP.cs
index 2470a6fc3c4..13e99c04f1f 100644
--- a/src/Microsoft.WSMan.Management/CredSSP.cs
+++ b/src/Microsoft.WSMan.Management/CredSSP.cs
@@ -200,9 +200,7 @@ private void DisableServerSideSettings()
return;
}
- string inputXml = string.Format(CultureInfo.InvariantCulture,
- @"false",
- helper.Service_CredSSP_XMLNmsp);
+ string inputXml = string.Create(CultureInfo.InvariantCulture, $@"false");
m_SessionObj.Put(helper.Service_CredSSP_Uri, inputXml, 0);
}
@@ -513,6 +511,7 @@ private void EnableClientSideSettings()
try
{
XmlDocument xmldoc = new XmlDocument();
+
// push the xml string with credssp enabled
xmldoc.LoadXml(m_SessionObj.Put(helper.CredSSP_RUri, newxmlcontent, 0));
@@ -592,9 +591,8 @@ private void EnableServerSideSettings()
try
{
XmlDocument xmldoc = new XmlDocument();
- string newxmlcontent = string.Format(CultureInfo.InvariantCulture,
- @"true",
- helper.Service_CredSSP_XMLNmsp);
+ string newxmlcontent = string.Create(CultureInfo.InvariantCulture, $@"true");
+
// push the xml string with credssp enabled
xmldoc.LoadXml(m_SessionObj.Put(helper.Service_CredSSP_Uri, newxmlcontent, 0));
WriteObject(xmldoc.FirstChild);
diff --git a/src/System.Management.Automation/DscSupport/CimDSCParser.cs b/src/System.Management.Automation/DscSupport/CimDSCParser.cs
index 904103f451d..ab7536b7e4f 100644
--- a/src/System.Management.Automation/DscSupport/CimDSCParser.cs
+++ b/src/System.Management.Automation/DscSupport/CimDSCParser.cs
@@ -2534,12 +2534,7 @@ private static void ProcessMembers(StringBuilder sb, List