Use interpolated strings 5c (#18997)

This commit is contained in:
CarloToso authored and GitHub committed 2023-01-21 17:49:12 +05:00
1 parent b85fe99f5a
commit 9cab34b7a7
3 files changed
+4 -4

No files matched your search

@@ -1092,7 +1092,7 @@ namespace System.Management.Automation
// When multiple copies of pwsh are on the system, they should use their own copy of the cache.
// Append hash of `$PSHOME` to cacheFileName.
string hashString = CRC32Hash.ComputeHash(Utils.DefaultPowerShellAppBase);
cacheFileName = string.Format(CultureInfo.InvariantCulture, "{0}-{1}", cacheFileName, hashString);
cacheFileName = string.Create(CultureInfo.InvariantCulture, $"{cacheFileName}-{hashString}");
if (ExperimentalFeature.EnabledExperimentalFeatureNames.Count > 0)
{
@@ -1118,7 +1118,7 @@ namespace System.Management.Automation
// Use CRC32 because it's faster.
// It's very unlikely to get collision from hashing the combinations of enabled features names.
hashString = CRC32Hash.ComputeHash(allNames);
cacheFileName = string.Format(CultureInfo.InvariantCulture, "{0}-{1}", cacheFileName, hashString);
cacheFileName = string.Create(CultureInfo.InvariantCulture, $"{cacheFileName}-{hashString}");
}
s_cacheStoreLocation = Path.Combine(Platform.CacheDirectory, cacheFileName);
@@ -995,7 +995,7 @@ namespace Microsoft.PowerShell.Commands
string errorMessageTemplate = string.Format(
CultureInfo.InvariantCulture,
Modules.RemoteDiscoveryRemotePsrpCommandFailed,
string.Format(CultureInfo.InvariantCulture, "Import-Module -Name '{0}'", moduleName));
string.Create(CultureInfo.InvariantCulture, $"Import-Module -Name '{moduleName}'"));
remotelyImportedModules = RemoteDiscoveryHelper.InvokePowerShell(
powerShell,
this,
@@ -4939,7 +4939,7 @@ namespace Microsoft.PowerShell.Commands
using var ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace);
ps.AddCommand(new CmdletInfo("Invoke-Command", typeof(InvokeCommandCommand)));
ps.AddParameter("Session", compatSession);
ps.AddParameter("ScriptBlock", ScriptBlock.Create(string.Format("Set-Location -Path '{0}'", args.NewPath.Path)));
ps.AddParameter("ScriptBlock", ScriptBlock.Create(string.Create(CultureInfo.InvariantCulture, $"Set-Location -Path '{args.NewPath.Path}'")));
ps.Invoke();
}
}