Command Not Found utility

Command Not Found is a powertoys utility – A PowerShell 7 module that detects command-line errors and suggests a relevant WinGet package to install, if available.

Sometimes, the cause of the “command not found” error could simply be because the program is not even installed in the first place. If the command you are trying to run is not a built-in shell command, it may be that the program is not installed on your system.

“Command not found” is an error message that is displayed in the terminal when the shell is unable to locate an executable file or command that you have entered. There are several reasons why this error can occur: You may have mistyped the command name. The command is not installed on your system.

the most common mistake is You may have mistyped the command name. The command is not installed on your system. The command is installed, but it is not in a directory listed in your PATH environment variable. The command requires superuser or root privileges to run and you are not currently running the shell as superuser or root. however it will be really easy if you activate this module.

Requirements

Command Not Found utility

Install the Command Not Found module

To install the module, navigate to the Command Not Found page in PowerToys settings and select the Install button. Once the module installation has completed, PowerShell 7 experimental features needed for the module to function will be enabled:

  • PSFeedbackProvider
  • PSCommandNotFoundSuggestion

After that, PowerShell profile file will be appended with following block of PowerShell commands:

#34de4b3d-13a8-4540-b76d-b9e8d3851756 PowerToys CommandNotFound module
Import-Module "<powertoys install dir>/WinGetCommandNotFound.psd1"
#34de4b3d-13a8-4540-b76d-b9e8d3851756

Note: The profile file will be created if needed. Restart PowerShell session to use the module.

Uninstall the module

To uninstall the module, navigate to the Command Not Found page in PowerToys settings and select the Uninstall button. Once the module uninstall has completed, the block of commands previously added will be removed from the PowerShell profile file.

Leave a Comment