diff --git a/package.json b/package.json index 341b4623a3..9a44a1079a 100644 --- a/package.json +++ b/package.json @@ -482,6 +482,11 @@ "default": true, "description": "Specifies the visibility of the Command Explorer in the PowerShell Side Bar." }, + "powershell.sideBar.CommandExplorerExcludeFilter": { + "type":"array", + "default":"", + "description": "Specify array of Modules to exclude from Command Explorer listing." + }, "powershell.powerShellExePath": { "type": "string", "default": "", diff --git a/src/features/GetCommands.ts b/src/features/GetCommands.ts index 0a269f3d3a..b109c74e73 100644 --- a/src/features/GetCommands.ts +++ b/src/features/GetCommands.ts @@ -64,6 +64,9 @@ export class GetCommandsFeature implements IFeature { return; } this.languageClient.sendRequest(GetCommandRequestType, "").then((result) => { + const SidebarConfig = vscode.workspace.getConfiguration("powershell.sideBar"); + const excludeFilter = (SidebarConfig.CommandExplorerExcludeFilter).map((filter) => filter.toLowerCase()); + result = result.filter((command) => (excludeFilter.indexOf(command.moduleName.toLowerCase()) === -1)); this.commandsExplorerProvider.powerShellCommands = result.map(toCommand); this.commandsExplorerProvider.refresh(); });