From 328b86f0f65f705df5849c586750e726b083ac88 Mon Sep 17 00:00:00 2001
From: CarloToso <105941898+CarloToso@users.noreply.github.com>
Date: Sat, 21 Jan 2023 18:07:23 +0100
Subject: [PATCH 1/6] 14 files
---
.../commands/utility/ImplicitRemotingCommands.cs | 7 ++-----
src/Microsoft.WSMan.Management/CredSSP.cs | 10 ++++------
.../DscSupport/CimDSCParser.cs | 14 ++------------
.../common/DisplayDatabase/typeDataXmlLoader.cs | 5 +----
.../DisplayDatabase/typeDataXmlLoader_Views.cs | 5 +----
.../cimSupport/other/ciminstancetypeadapter.cs | 9 ++-------
.../engine/ManagementObjectAdapter.cs | 4 +---
.../engine/parser/DebugViewWriter.cs | 7 +------
.../remoting/commands/CustomShellCommands.cs | 4 +---
.../remoting/fanin/OutOfProcTransportManager.cs | 15 ++-------------
.../remoting/fanin/WSManPluginShellSession.cs | 6 +-----
.../help/HelpCommentsParser.cs | 4 +---
.../utils/tracing/SysLogProvider.cs | 10 ++--------
src/TypeCatalogGen/TypeCatalogGen.cs | 4 +---
14 files changed, 22 insertions(+), 82 deletions(-)
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