diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index 51600d157da..8138bd08031 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -4213,15 +4213,6 @@ .FORWARDHELPCATEGORY Cmdlet [string[]] ${Category}, - [string[]] - ${Component}, - - [string[]] - ${Functionality}, - - [string[]] - ${Role}, - [Parameter(ParameterSetName='DetailedView', Mandatory=$true)] [switch] ${Detailed}, @@ -4238,6 +4229,15 @@ .FORWARDHELPCATEGORY Cmdlet [string] ${Parameter}, + [string[]] + ${Component}, + + [string[]] + ${Functionality}, + + [string[]] + ${Role}, + [Parameter(ParameterSetName='Online', Mandatory=$true)] [switch] ${Online}, diff --git a/src/System.Management.Automation/help/HelpCommands.cs b/src/System.Management.Automation/help/HelpCommands.cs index 1ddfe090604..b9a40818b51 100644 --- a/src/System.Management.Automation/help/HelpCommands.cs +++ b/src/System.Management.Automation/help/HelpCommands.cs @@ -68,27 +68,6 @@ public GetHelpCommand() IgnoreCase = true)] public string[] Category { get; set; } - /// - /// List of Component's to search on. - /// - /// - [Parameter] - public string[] Component { get; set; } = null; - - /// - /// List of Functionality's to search on. - /// - /// - [Parameter] - public string[] Functionality { get; set; } = null; - - /// - /// List of Role's to search on. - /// - /// - [Parameter] - public string[] Role { get; set; } = null; - private string _provider = string.Empty; /// @@ -180,6 +159,24 @@ public SwitchParameter Examples [Parameter(ParameterSetName = "Parameters", Mandatory = true)] public string Parameter { set; get; } + /// + /// Gets and sets list of Component's to search on. + /// + [Parameter] + public string[] Component { get; set; } + + /// + /// Gets and sets list of Functionality's to search on. + /// + [Parameter] + public string[] Functionality { get; set; } + + /// + /// Gets and sets list of Role's to search on. + /// + [Parameter] + public string[] Role { get; set; } + /// /// This parameter,if true, will direct get-help cmdlet to /// navigate to a URL (stored in the command MAML file under diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index 505b11d87eb..5d9944a0714 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -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' -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' -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