Repository navigation
Description
Summary of the new feature / enhancement
As a user, when I mistype a cmdlet or native command, I want to be able to see suggestions descriptive name and the modules they come from in order to more clearly understand suggestions to help me succeed.
When I mistype a particular command and am returned suggestions, it is unclear what the aliased cmds do and if they are actually related to what I am trying to do or not. For example, when I type gitt I get the following suggestions:
PS C:\Users\stevenbucher> gitt
gitt: The term 'gitt' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Suggestion [4,General]: The most similar commands are: gi, gin, gtz, It, imt.It is not clear exactly what these aliased commands are and thus I have to investigate further, I have to do Get-Command <cmd> to learn more. This is good but it would be more helpful if this was given to me right after my initial error.
Another example can be when I may type something like
PS C:\Users\stevenbucher> Get-PSResurce
Get-PSResurce: The term 'Get-PSResurce' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Suggestion [4,General]: The most similar commands are: Get-PSResource, Get-AzResource, Get-DscResource, Set-AzResource, Get-PSSession, Get-Service.It would be helpful to know which modules each of these suggestions came from. Similar to what bash does
stevenbucher@StevenBucherPC:~$ sudi
Command 'sudi' not found, did you mean:
command 'sudo' from deb sudo (1.8.31-1ubuntu1.2)
command 'sudo' from deb sudo-ldap (1.8.31-1ubuntu1.2)
Try: sudo apt install <deb name>I would love to hear other's thoughts on this feature! Thanks!
Proposed technical implementation details (optional)
Have more detailed suggestions for when suggestions are given. See examples below:
PS C:\Users\stevenbucher> gitt
gitt: The term 'gitt' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Suggestion:
CommandType Name Version Source
----------- ---- ------- ------
Alias gi -> Get-Item
Alias gin -> Get-ComputerInfo 7.0.0.0 Microsoft.PowerShell.Management
Alias gtz -> Get-TimeZone 7.0.0.0 Microsoft.PowerShell.Management
Function It 5.3.3 Pester
Alias imt -> Invoke-PSMDTemplate 2.2.11.139 PSModuleDevelopmentPS C:\Users\stevenbucher> Get-PSresurce
Get-PSresurce: The term 'Get-PSresurce' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Suggestion:
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Get-PSResource 3.0.12 PowerShellGet
Cmdlet Get-AzResource 6.0.1 Az.Resources
Function Get-DscResource 1.1 PSDesiredStateConfiguration
Cmdlet Set-AzResource 6.0.1 Az.Resources
Function Get-PSFFeature 1.7.237 PSFramework
Function Get-PSFMessage 1.7.237 PSFramework
Activity
jhoneill commentedon Jul 26, 2022
The first example shows that the process is not checking for external programs, which is something which should also be addressed.
This is an experimental feature which some people may prefer to leave disabled - in the case of simple typing errors we (probably) know we mean "git" or "Get-PSResource" - some people may want the current one line version and some may want the full details. So this should be an option and so should the one line version. (since the feature is still experimental, the default can be discussed) .
At present the alias is an issue. I know that
fl/ft/fwareformat-List / Table / Wideand I know there is aformat-hexcommand so I try thishmight be the alias, so mightoh,fcdoesn't look likely and I can eliminate fl/ft/fw and f: but nothing is making fhx jump out and I might need to spend longer looking at the list thing "It OH for out-hex ? no that'sOut-hostH for Hex ? No that'shistory" and so onSome aliases don't have their source (fc / fl / ft for example) and some don't show where they go until the module is loaded (fimo for example):
Since I mention fimo , fm doesn't find it
Like fh it would help the search if the logic says F & H or F & M might be the first letters of the full command
so if we find an alias for something where the canonical name is f*-h* or f*-m* those are good matches. It's not likely that I want % ? or cp when I typed fm.
So there is work to do before this feature comes out of experimental status.
microsoft-github-policy-service commentedon Nov 15, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
soredake commentedon Nov 19, 2023
Still wanted.
microsoft-github-policy-service commentedon Nov 26, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.
microsoft-github-policy-service commentedon Nov 26, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.