- Notifications
You must be signed in to change notification settings - Fork8.1k
Open
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on thelatest released version
- Search the existing issues.
- Refer to theFAQ.
- Refer toDifferences between Windows PowerShell 5.1 and PowerShell.
Description
On Windows, native commands are typically invoked without their extension (e.g.,notepad instead ofnotepad.exe). If a typo is made with this type of command invocation,PSCommandNotFoundSuggestion is unhelpful.
PSCommandNotFoundSuggestion doesn't check external applications unless you add .exe to the command #10786 from 2019 reported the same issue, in which@SteveL-MSFT commented the following:
This is already addressed by the fuzzy matching feature for CommandNotFound error
As of v7.6.0-preview.5,
PSCommandNotFoundSuggestiondoesn't account for this. No suggestion is generated, as omission of the extension appears to exceed the fuzzy matching distance.
For example:
ntepadyields no suggestions, despite deviating from the validnotepadcommand by just a single character.- Invoking
ntepad.exeornotepad.exis necessary to generate a suggestion.
Steps to reproduce
- Ensure the
PSFeedbackProviderexperimental feature is enabled. - On Windows, enter
ntepadinto the shell.
Expected behavior
notepad/notepad.exe is suggested.
ntepad: The term 'ntepad' 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.[General Feedback] The most similar commands are: > notepadActual behavior
No suggestion is generated.
ntepad: The term 'ntepad' 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.Environment data
Name Value---------PSVersion7.6.0-preview.5PSEdition CoreGitCommitId7.6.0-preview.5OS Microsoft Windows10.0.19045Platform Win32NTPSCompatibleVersions {1.0,2.0,3.0,4.0,5.0,5.1…}PSRemotingProtocolVersion2.4SerializationVersion1.1.0.1WSManStackVersion3.0