diff --git a/package.json b/package.json index cf8dfc092b..bd62299bab 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.CommandExplorerInitialRefresh": { + "type":"boolean", + "default":true, + "description": "Toggle the initial refresh of the command explorer." + }, "powershell.powerShellExePath": { "type": "string", "default": "", diff --git a/src/features/GetCommands.ts b/src/features/GetCommands.ts index 0821a65a2d..9134a5185a 100644 --- a/src/features/GetCommands.ts +++ b/src/features/GetCommands.ts @@ -42,7 +42,10 @@ export class GetCommandsFeature implements IFeature { public setLanguageClient(languageclient: LanguageClient) { this.languageClient = languageclient; - vscode.commands.executeCommand("PowerShell.RefreshCommandsExplorer"); + const SideBarConfiguration = vscode.workspace.getConfiguration("powershell.sideBar"); + if (SideBarConfiguration.CommandExplorerInitialRefresh) { + vscode.commands.executeCommand("PowerShell.RefreshCommandsExplorer"); + } } private CommandExplorerRefresh() {