Since the -Full parameter of the Get-Help cmdlet (and help function) is used much more frequently than the -Functionality parameter it would be useful to change the order they show up when using Tab completion.
Also, alpabetically, Full goes earlier than Functionality.
Get-Help -Fu<tab>
Get-Help -Full
Get-Help -Functionality
> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0-preview.4
PSEdition Core
GitCommitId 6.1.0-preview.4
OS Microsoft Windows 10.0.17134
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
_Consistently_ tab-completing parameter names _alphabetically sorted_ makes sense.
By contrast, I don't think that fixing it on a _per-cmdlet basis_ based on (perceived) frequency of use is the right solution.
I suggest creating a new issue and PR for sorted completions.
@sethvs:
I appreciate your willingness to not only report problems but also _fix_ them, but, before submitting a PR, I suggest waiting for feedback so that a consensus can be reached as to _if and how_ the problem needs solving.
You'll save yourself and others potentially unnecessary effort.
I agree with @mklement0 that we should fix this at the tabexpansion level so that it's consistent in all cases rather than a specific cmdlet. From a predictability standpoint, it makes sense to have it alphabetical. However, it may also make sense to have it based on "most used" (more work would be needed to make this happen). Of course, one solution to that is to make it configurable...
Ooh, might be cool if we had alternate completion orders. One alphabetical and another by most commonly used (or most recently used), etc. Perhaps that is a preference setting or maybe we could switch from the default order using tab / shift+tab to an alternate order using ctrl+tab / ctrl+shift+tab.
Get-Help -<Tab> - I'd expect "first most commonly used" orderGet-Help -F<Tab> - I'd expect alphabetical order@mklement0 I'm very glad that you appreciate my effort, but I prefer arranging my time myself. Thank you.
@sethvs:
My advice was well-meaning and - hopefully - sensible.
If you disagree, I'm happy to debate the _content_ of the latter claim with you.
Otherwise, please stop posting passive-aggressive responses.
@mklement0
Thank you for the advice. If I ever need another one, I will definitely ask.
I suggest concentrating on the issue topic if you don't mind.
Thank you again.
I assume we're talking about a _user-specific_ learning feature / MRU feature (as a generic feature, users may disagree on what parameters are the most important ones, and it hurts predictability).
If we're going for this, my vote is for a separate, parallel invocation mechanism, as @rkeithhill proposes.
However, it sounds like a nontrivial effort and I see its value as limited in a sysadmin world, where users frequently work on many different machines, possibly using different user accounts. You won't remember which machines / accounts have learned what, and the resulting lack of predictability may be frustrating.
Alphabetic sorting provides predictability, as @SteveL-MSFT notes.
Similarly, _short parameter aliases_ provide (machine- and user-independent) predictability and, once memorized, do not even require tab completion (though their use is best avoided in _scripts_ for the sake of readability); e.g., -ov for -Out-Variable.
Of course, the short aliases would have to be built into the cmdlets themselves:
There's also #2199, which proposes the introduction of user-defined parameter aliases, which I would also advise against.
@SteveL-MSFT:
As you suggested, I've created a new issue: #7416
However, it only covers _alphabetical_ sorting (though it links back here for the alternative proposals).
If you, @rkeithhill, or @iSazonov feel strongly enough about alternative completion orders, I encourage you to create another issue.
Most helpful comment
I agree with @mklement0 that we should fix this at the tabexpansion level so that it's consistent in all cases rather than a specific cmdlet. From a predictability standpoint, it makes sense to have it alphabetical. However, it may also make sense to have it based on "most used" (more work would be needed to make this happen). Of course, one solution to that is to make it configurable...