Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ static AnalysisCacheData()
// 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)
{
Expand All @@ -1118,7 +1118,7 @@ static AnalysisCacheData()
// 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ private IList<PSModuleInfo> ImportModule_RemotelyViaPsrpSession(
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4939,7 +4939,7 @@ internal static void SyncCurrentLocationHandler(object sender, LocationChangedEv
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();
}
}
Expand Down