You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Add suggestions for common cmd.exe commands #9006
Users trying to move from cmd to PowerShell struggle with muscle memory on commands like dir /s which don't work since dir is an alias to get-childitem and parameters start with a hyphen and /s for subdirectories would need to be -r for recursion.
Have a built in list of common cmd built-in commands and when the user tries it, a CommandNotFoundException is thrown the suggestion framework can suggest the PowerShell equivalent.
We've discussed getting telemetry on errors as it would tell us what issues customers are having but there are privacy concerns of the contents of the ErrorRecord
Could we also get suggestions for common native exes on Windows? I should get suggestions when I mis-type git, bash, npm, python, gcc, node, etc. Today the experience isn't very helpful on Windows:
08-07 14:50:32 7> npn run build
npn: The term 'npn' is not recognized as the name of a cmdlet, function, script file, or operable 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: nsn, cp, cpi, gp, gpv, gps, mp, nal, ndr, ni.
[user/hill/ULC-3286-impl-install-license-service-stub +0 ~7 -0 !] KLM:src\KeysightLicenseManager
!08-07 14:50:38 8> gir fetch
gir: The term 'gir' is not recognized as the name of a cmdlet, function, script file, or operable 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: dir, gdr, gi, gin, gip, gal, gbp, gc.
NOTE: suggestions work better on Linux for some reason:
08-07 15:02:33 4> npn run build
npn: The term 'npn' is not recognized as the name of a cmdlet, function, script file, or operable 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: nsn, npm, npx, cpi, gp, gpv, gps.
/home/hillr
08-07 15:03:47 5> gir fetch
gir: The term 'gir' is not recognized as the name of a cmdlet, function, script file, or operable 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: dir, gdr, gi, git, gal, gbp, gc, gci, gcm.
/home/hillr
After discussing wit the working group, we feel this is a very specific scenario that can cause additional confusion with users scripting commands. This also would not necessarily prevent similar usage errors from occurring unless all the parameters for a command are resolved to - parameters. One area we think this might be considered is with the suggestion framework, however it doesn't resolve the problem of incorrect usage in scripts. Error will still be produced. The current error produced form Dir /s is very explanatory.
Activity
iSazonov commentedon Feb 28, 2019
Can MSFT use telemetry to collect such errors? This would greatly facilitate the work (and make it "portable" - Unix users haven't such problems?).
SteveL-MSFT commentedon Feb 28, 2019
Ilya (@iSazonov) feel free to add that to PowerShell/PowerShell-RFC#158
We've discussed getting telemetry on errors as it would tell us what issues customers are having but there are privacy concerns of the contents of the ErrorRecord
iSazonov commentedon Mar 1, 2019
Steve Lee (@SteveL-MSFT) Done.
iSazonov commentedon Mar 1, 2019
Perhaps it is good area for (local) ML/AI.
rkeithhill commentedon Aug 7, 2020
Could we also get suggestions for common native exes on Windows? I should get suggestions when I mis-type git, bash, npm, python, gcc, node, etc. Today the experience isn't very helpful on Windows:
NOTE: suggestions work better on Linux for some reason:
🤷♂️
iSazonov commentedon Nov 30, 2021
It would be great to have more meta data about Windows utilities in a format that we could use in IntelliSense, argument binding and so on.
theJasonHelmick commentedon May 26, 2022
After discussing wit the working group, we feel this is a very specific scenario that can cause additional confusion with users scripting commands. This also would not necessarily prevent similar usage errors from occurring unless all the parameters for a command are resolved to - parameters. One area we think this might be considered is with the suggestion framework, however it doesn't resolve the problem of incorrect usage in scripts. Error will still be produced. The current error produced form
Dir /sis very explanatory.