Skip to content
Merged
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
18 changes: 9 additions & 9 deletions src/System.Management.Automation/engine/InitialSessionState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4213,15 +4213,6 @@ .FORWARDHELPCATEGORY Cmdlet
[string[]]
${Category},

[string[]]
${Component},

[string[]]
${Functionality},

[string[]]
${Role},

[Parameter(ParameterSetName='DetailedView', Mandatory=$true)]
[switch]
${Detailed},
Expand All @@ -4238,6 +4229,15 @@ .FORWARDHELPCATEGORY Cmdlet
[string]
${Parameter},

[string[]]
${Component},

[string[]]
${Functionality},

[string[]]
${Role},

[Parameter(ParameterSetName='Online', Mandatory=$true)]
[switch]
${Online},
Expand Down
39 changes: 18 additions & 21 deletions src/System.Management.Automation/help/HelpCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,6 @@ public GetHelpCommand()
IgnoreCase = true)]
public string[] Category { get; set; }

/// <summary>
/// List of Component's to search on.
/// </summary>
/// <value></value>
[Parameter]
public string[] Component { get; set; } = null;

/// <summary>
/// List of Functionality's to search on.
/// </summary>
/// <value></value>
[Parameter]
public string[] Functionality { get; set; } = null;

/// <summary>
/// List of Role's to search on.
/// </summary>
/// <value></value>
[Parameter]
public string[] Role { get; set; } = null;

private string _provider = string.Empty;

/// <summary>
Expand Down Expand Up @@ -180,6 +159,24 @@ public SwitchParameter Examples
[Parameter(ParameterSetName = "Parameters", Mandatory = true)]
public string Parameter { set; get; }

/// <summary>
/// Gets and sets list of Component's to search on.
/// </summary>
[Parameter]
public string[] Component { get; set; }

/// <summary>
/// Gets and sets list of Functionality's to search on.
/// </summary>
[Parameter]
public string[] Functionality { get; set; }

/// <summary>
/// Gets and sets list of Role's to search on.
/// </summary>
[Parameter]
public string[] Role { get; set; }

/// <summary>
/// This parameter,if true, will direct get-help cmdlet to
/// navigate to a URL (stored in the command MAML file under
Expand Down
12 changes: 12 additions & 0 deletions test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ Describe "TabCompletion" -Tags CI {
$res.CompletionMatches[0].CompletionText | Should -Be 'namespace'
}

It 'Should first suggest -Full and then -Functionality when using Get-Help -Fu<tab>' -skip {
$res = TabExpansion2 -inputScript 'Get-Help -Fu' -cursorColumn 'Get-Help -Fu'.Length
$res.CompletionMatches[0].CompletionText | Should -BeExactly '-Full'
$res.CompletionMatches[1].CompletionText | Should -BeExactly '-Functionality'
}

It 'Should first suggest -Full and then -Functionality when using help -Fu<tab>' -skip {
$res = TabExpansion2 -inputScript 'help -Fu' -cursorColumn 'help -Fu'.Length
$res.CompletionMatches[0].CompletionText | Should -BeExactly '-Full'
$res.CompletionMatches[1].CompletionText | Should -BeExactly '-Functionality'
}

Context NativeCommand {
BeforeAll {
$nativeCommand = (Get-Command -CommandType Application -TotalCount 1).Name
Expand Down