The title of this post is one of the most common errors you’ll see when using PowerShell. It’s pretty literal. It means PowerShell couldn’t find any command with the name you specified.
I’ve found that it’s very common to hit this error for two specific occasions.
1. You mistyped the command you meant to run.
2. You tried to run a command in the current directory but forgot to prepend it with .\
This second reason is a lot more common for beginners, especially if they are used to cmd.exe. cmd.exe will search the current directory for commands, but PowerShell won’t unless it happens to be in the PATH environment variable. This helps to prevent trojan attacks. If you want to run a command in a directory not in your PATH you have to specify the directory. For the current directory, a quick solution is to prepend your command with .\ For example, rather than running script.ps1, run .\script.ps1
July 29, 2009 at 1:59 am
[...] In the same way that you must prepend a powershell script with . e.g. .ripper.ps1, you must also prepend exe’s with . if the directory containing the exe is not in your PATH statement. [...]
September 21, 2009 at 1:04 am
Thanks the “.\” part did it. Why can’t Microsoft program the ability for the program to simple state that that is needed when you just type in a file name?