From 680c6d43ec63931af8d1d7b13ed9c0c988d4cc6c Mon Sep 17 00:00:00 2001 From: deadlydog Date: Tue, 24 Nov 2020 00:01:38 -0600 Subject: [PATCH] fix #1393: Always use local help to return cmdlet help text If the user has overridden the Get-Help -Online parameter to always be true, then calls to Get-Help will always launch a new browser window to the cmdlet help. Instead, we want it to return the full cmdlet text as intended, otherwise things like intellisense and tooltips may end up opening the cmdlet help in a new browser window. --- .../Services/PowerShellContext/Utilities/CommandHelpers.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs b/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs index 79faecb06..ea423ce46 100644 --- a/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs +++ b/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs @@ -139,6 +139,7 @@ public static async Task GetCommandSynopsisAsync( // We use .Name here instead of just passing in commandInfo because // CommandInfo.ToString() duplicates the Prefix if one exists. .AddParameter("Name", commandInfo.Name) + .AddParameter("Online", false) .AddParameter("ErrorAction", "Ignore"); var results = await powerShellContext.ExecuteCommandAsync(command, sendOutputToHost: false, sendErrorToHost: false).ConfigureAwait(false);