diff --git a/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs b/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs index 4dc94b55b..fac925604 100644 --- a/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs +++ b/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System.Collections.Concurrent; -using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Threading.Tasks; @@ -15,38 +14,6 @@ namespace Microsoft.PowerShell.EditorServices.Services.PowerShellContext /// internal static class CommandHelpers { - private static readonly HashSet s_nounExclusionList = new HashSet - { - // PowerShellGet v2 nouns - "CredsFromCredentialProvider", - "DscResource", - "InstalledModule", - "InstalledScript", - "PSRepository", - "RoleCapability", - "Script", - "ScriptFileInfo", - - // PackageManagement nouns - "Package", - "PackageProvider", - "PackageSource", - }; - - // This is used when a noun exists in multiple modules (for example, "Command" is used in Microsoft.PowerShell.Core and also PowerShellGet) - private static readonly HashSet s_cmdletExclusionList = new HashSet - { - // Commands in PowerShellGet with conflicting nouns - "Find-Command", - "Find-Module", - "Install-Module", - "Publish-Module", - "Save-Module", - "Uninstall-Module", - "Update-Module", - "Update-ModuleManifest", - }; - private static readonly ConcurrentDictionary s_commandInfoCache = new ConcurrentDictionary(); @@ -72,17 +39,6 @@ public static async Task GetCommandInfoAsync( return cmdInfo; } - // Make sure the command's noun or command's name isn't in the exclusion lists. - // This is currently necessary to make sure that Get-Command doesn't - // load PackageManagement or PowerShellGet v2 because they cause - // a major slowdown in IntelliSense. - var commandParts = commandName.Split('-'); - if ((commandParts.Length == 2 && s_nounExclusionList.Contains(commandParts[1])) - || s_cmdletExclusionList.Contains(commandName)) - { - return null; - } - PSCommand command = new PSCommand(); command.AddCommand(@"Microsoft.PowerShell.Core\Get-Command"); command.AddArgument(commandName);