From d4e802148c21c404c84d36f73ebb0a8c4416ca09 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 6 Dec 2017 12:37:41 -0800 Subject: [PATCH] Remove 'oldPowershellExeName' and 'oldPowershellDepsName' (#5408) --- .../engine/Modules/ModuleIntrinsics.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs index 0d1909dcfb..a6b70bbc46 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs @@ -769,13 +769,10 @@ namespace System.Management.Automation { #if UNIX const string powershellExeName = "pwsh"; - const string oldPowershellExeName = "powershell"; #else const string powershellExeName = "pwsh.exe"; - const string oldPowershellExeName = "powershell.exe"; #endif const string powershellDepsName = "pwsh.deps.json"; - const string oldPowershellDepsName = "powershell.deps.json"; StringBuilder modulePathString = new StringBuilder(currentProcessModulePath.Length); char[] invalidPathChars = Path.GetInvalidPathChars(); @@ -796,10 +793,8 @@ namespace System.Management.Automation { string parentDir = Path.GetDirectoryName(trimedPath); string psExePath = Path.Combine(parentDir, powershellExeName); - string oldExePath = Path.Combine(parentDir, oldPowershellExeName); string psDepsPath = Path.Combine(parentDir, powershellDepsName); - string oldDepsPath = Path.Combine(parentDir, oldPowershellDepsName); - if ((File.Exists(psExePath) && File.Exists(psDepsPath)) || (File.Exists(oldExePath) && File.Exists(oldDepsPath))) + if ((File.Exists(psExePath) && File.Exists(psDepsPath))) { // Path is a PSHome module path from a different powershell core instance. Ignore it. continue;