Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/PowerShell/PowerShell.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-10-25 22:45:42 +0300
committerGitHub <noreply@github.com>2022-10-25 22:45:42 +0300
commit476b0c5d12a0ab0076dddc888d151f47338c7af9 (patch)
tree3263d234d1b329d9e0d3941a42874c2bbb1b1494
parenta5739b17393d2976a6a89481ed3ab7f6b4c19603 (diff)
[release/v7.3.0-rc.1] Remove the `ProcessorArchitecture` portion from the full name as it's obsolete (#18381)
-rw-r--r--src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs45
-rw-r--r--test/xUnit/csharp/test_MshSnapinInfo.cs2
2 files changed, 19 insertions, 28 deletions
diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs
index e3ce3a406d..05f8991e4a 100644
--- a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs
+++ b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs
@@ -865,7 +865,7 @@ namespace System.Management.Automation
return v;
}
- internal static void ReadRegistryInfo(out Version assemblyVersion, out string publicKeyToken, out string culture, out string architecture, out string applicationBase, out Version psVersion)
+ internal static void ReadRegistryInfo(out Version assemblyVersion, out string publicKeyToken, out string culture, out string applicationBase, out Version psVersion)
{
applicationBase = Utils.DefaultPowerShellAppBase;
Dbg.Assert(
@@ -885,8 +885,7 @@ namespace System.Management.Automation
// culture, publickeytoken...This will break the scenarios where only one of
// the assemblies is patched. ie., all monad assemblies should have the
// same version number.
- Assembly currentAssembly = typeof(PSSnapInReader).Assembly;
- AssemblyName assemblyName = currentAssembly.GetName();
+ AssemblyName assemblyName = typeof(PSSnapInReader).Assembly.GetName();
assemblyVersion = assemblyName.Version;
byte[] publicTokens = assemblyName.GetPublicKeyToken();
if (publicTokens.Length == 0)
@@ -899,11 +898,6 @@ namespace System.Management.Automation
// save some cpu cycles by hardcoding the culture to neutral
// assembly should never be targeted to a particular culture
culture = "neutral";
-
- // Hardcoding the architecture MSIL as PowerShell assemblies are architecture neutral, this should
- // be changed if the assumption is broken. Preferred hardcoded string to using (for perf reasons):
- // string architecture = currentAssembly.GetName().ProcessorArchitecture.ToString()
- architecture = "MSIL";
}
/// <summary>
@@ -931,13 +925,12 @@ namespace System.Management.Automation
/// </returns>
internal static PSSnapInInfo ReadCoreEngineSnapIn()
{
- Version assemblyVersion, psVersion;
- string publicKeyToken = null;
- string culture = null;
- string architecture = null;
- string applicationBase = null;
-
- ReadRegistryInfo(out assemblyVersion, out publicKeyToken, out culture, out architecture, out applicationBase, out psVersion);
+ ReadRegistryInfo(
+ out Version assemblyVersion,
+ out string publicKeyToken,
+ out string culture,
+ out string applicationBase,
+ out Version psVersion);
// System.Management.Automation formats & types files
Collection<string> types = new Collection<string>(new string[] { "types.ps1xml", "typesv3.ps1xml" });
@@ -946,8 +939,8 @@ namespace System.Management.Automation
"Help.format.ps1xml", "HelpV3.format.ps1xml", "PowerShellCore.format.ps1xml", "PowerShellTrace.format.ps1xml",
"Registry.format.ps1xml"});
- string strongName = string.Format(CultureInfo.InvariantCulture, "{0}, Version={1}, Culture={2}, PublicKeyToken={3}, ProcessorArchitecture={4}",
- s_coreSnapin.AssemblyName, assemblyVersion, culture, publicKeyToken, architecture);
+ string strongName = string.Format(CultureInfo.InvariantCulture, "{0}, Version={1}, Culture={2}, PublicKeyToken={3}",
+ s_coreSnapin.AssemblyName, assemblyVersion, culture, publicKeyToken);
string moduleName = Path.Combine(applicationBase, s_coreSnapin.AssemblyName + ".dll");
@@ -985,13 +978,12 @@ namespace System.Management.Automation
/// </returns>
internal static Collection<PSSnapInInfo> ReadEnginePSSnapIns()
{
- Version assemblyVersion, psVersion;
- string publicKeyToken = null;
- string culture = null;
- string architecture = null;
- string applicationBase = null;
-
- ReadRegistryInfo(out assemblyVersion, out publicKeyToken, out culture, out architecture, out applicationBase, out psVersion);
+ ReadRegistryInfo(
+ out Version assemblyVersion,
+ out string publicKeyToken,
+ out string culture,
+ out string applicationBase,
+ out Version psVersion);
// System.Management.Automation formats & types files
Collection<string> smaFormats = new Collection<string>(new string[]
@@ -1010,12 +1002,11 @@ namespace System.Management.Automation
string strongName = string.Format(
CultureInfo.InvariantCulture,
- "{0}, Version={1}, Culture={2}, PublicKeyToken={3}, ProcessorArchitecture={4}",
+ "{0}, Version={1}, Culture={2}, PublicKeyToken={3}",
defaultMshSnapinInfo.AssemblyName,
assemblyVersionString,
culture,
- publicKeyToken,
- architecture);
+ publicKeyToken);
Collection<string> formats = null;
Collection<string> types = null;
diff --git a/test/xUnit/csharp/test_MshSnapinInfo.cs b/test/xUnit/csharp/test_MshSnapinInfo.cs
index 2742ba71c0..039825025d 100644
--- a/test/xUnit/csharp/test_MshSnapinInfo.cs
+++ b/test/xUnit/csharp/test_MshSnapinInfo.cs
@@ -17,7 +17,7 @@ namespace PSTests.Parallel
Skip.IfNot(Platform.IsWindows);
Version someVersion = null;
string someString = null;
- PSSnapInReader.ReadRegistryInfo(out someVersion, out someString, out someString, out someString, out someString, out someVersion);
+ PSSnapInReader.ReadRegistryInfo(out someVersion, out someString, out someString, out someString, out someVersion);
}
// PublicKeyToken is null on Linux