From 060eeb5684720d445a5eb35ff68896c16960d1b2 Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Wed, 29 Sep 2021 11:11:42 -0400 Subject: [PATCH 1/2] Fix incorrect ErrorAction values in CommandHelpers.cs --- .../Services/PowerShellContext/Utilities/CommandHelpers.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs b/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs index 4dc94b55b..f42a0e767 100644 --- a/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs +++ b/src/PowerShellEditorServices/Services/PowerShellContext/Utilities/CommandHelpers.cs @@ -86,7 +86,7 @@ public static async Task GetCommandInfoAsync( PSCommand command = new PSCommand(); command.AddCommand(@"Microsoft.PowerShell.Core\Get-Command"); command.AddArgument(commandName); - command.AddParameter("ErrorAction", "Ignore"); + command.AddParameter("ErrorAction", "SilentlyContinue"); CommandInfo commandInfo = (await powerShellContext.ExecuteCommandAsync(command, sendOutputToHost: false, sendErrorToHost: false).ConfigureAwait(false)) .Select(o => o.BaseObject) @@ -138,7 +138,7 @@ public static async Task GetCommandSynopsisAsync( // CommandInfo.ToString() duplicates the Prefix if one exists. .AddParameter("Name", commandInfo.Name) .AddParameter("Online", false) - .AddParameter("ErrorAction", "Ignore"); + .AddParameter("ErrorAction", "SilentlyContinue"); var results = await powerShellContext.ExecuteCommandAsync(command, sendOutputToHost: false, sendErrorToHost: false).ConfigureAwait(false); PSObject helpObject = results.FirstOrDefault(); From 9041ac51b9b4f2fb3b61a2d0ebf7fbb9fe9ebc32 Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Wed, 29 Sep 2021 11:13:39 -0400 Subject: [PATCH 2/2] Fix incorrect ErrorAction value in DscBreakpointCapability.cs --- .../Session/Capabilities/DscBreakpointCapability.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PowerShellEditorServices/Services/PowerShellContext/Session/Capabilities/DscBreakpointCapability.cs b/src/PowerShellEditorServices/Services/PowerShellContext/Session/Capabilities/DscBreakpointCapability.cs index 09f795cc4..b484c60ca 100644 --- a/src/PowerShellEditorServices/Services/PowerShellContext/Session/Capabilities/DscBreakpointCapability.cs +++ b/src/PowerShellEditorServices/Services/PowerShellContext/Session/Capabilities/DscBreakpointCapability.cs @@ -97,7 +97,7 @@ public static DscBreakpointCapability CheckForCapability( powerShell.AddCommand("Import-Module"); powerShell.AddArgument(@"C:\Program Files\DesiredStateConfiguration\1.0.0.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psd1"); powerShell.AddParameter("PassThru"); - powerShell.AddParameter("ErrorAction", "Ignore"); + powerShell.AddParameter("ErrorAction", "SilentlyContinue"); PSObject moduleInfo = null;