@@ -21,12 +21,13 @@ public class CommandHelpers
21
21
/// <param name="powerShellContext">The PowerShellContext to use for running Get-Command.</param>
22
22
/// <returns>A CommandInfo object with details about the specified command.</returns>
23
23
public static async Task < CommandInfo > GetCommandInfo (
24
- string commandName ,
24
+ string commandName ,
25
25
PowerShellContext powerShellContext )
26
26
{
27
27
PSCommand command = new PSCommand ( ) ;
28
28
command . AddCommand ( @"Microsoft.PowerShell.Core\Get-Command" ) ;
29
29
command . AddArgument ( commandName ) ;
30
+ command . AddParameter ( "ErrorAction" , "Ignore" ) ;
30
31
31
32
return
32
33
( await powerShellContext
@@ -43,7 +44,7 @@ public static async Task<CommandInfo> GetCommandInfo(
43
44
/// <param name="powerShellContext">The PowerShellContext to use for getting command documentation.</param>
44
45
/// <returns></returns>
45
46
public static async Task < string > GetCommandSynopsis (
46
- CommandInfo commandInfo ,
47
+ CommandInfo commandInfo ,
47
48
PowerShellContext powerShellContext )
48
49
{
49
50
string synopsisString = string . Empty ;
@@ -58,6 +59,7 @@ public static async Task<string> GetCommandSynopsis(
58
59
PSCommand command = new PSCommand ( ) ;
59
60
command . AddCommand ( @"Microsoft.PowerShell.Core\Get-Help" ) ;
60
61
command . AddArgument ( commandInfo ) ;
62
+ command . AddParameter ( "ErrorAction" , "Ignore" ) ;
61
63
62
64
var results = await powerShellContext . ExecuteCommand < PSObject > ( command , false , false ) ;
63
65
helpObject = results . FirstOrDefault ( ) ;
0 commit comments