Skip to content

Fix incorrect ErrorAction values #1575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static async Task<CommandInfo> 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<PSObject>(command, sendOutputToHost: false, sendErrorToHost: false).ConfigureAwait(false))
.Select(o => o.BaseObject)
Expand Down Expand Up @@ -138,7 +138,7 @@ public static async Task<string> 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<PSObject>(command, sendOutputToHost: false, sendErrorToHost: false).ConfigureAwait(false);
PSObject helpObject = results.FirstOrDefault();
Expand Down