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
(A few more words about this subject here.)
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?
December 16, 2009 at 1:35 am |
Or if you are a really clueless n00b like me, you may be trying to run Exchange commands in a Powershell Window – Change it to the Exchange Management Shell. Oops!
November 11, 2010 at 4:01 am |
[...] message by mosoto (Marcel J. Ortiz Soto) answered this as one of the first in the search results for “is not [...]
January 8, 2011 at 7:38 pm |
[...] 4.http://mosoto.wordpress.com/2008/09/20/the-term-is-not-recognized-as-a-cmdlet-function-operable-prog… [...]
April 1, 2011 at 9:14 am |
so great post for me, thank you very much
July 27, 2011 at 10:56 am |
find software…
The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. « mosoto’s Weblog…
August 22, 2011 at 4:48 pm |
F#&K, command line language! This is 2010. Where’s the button in an interface that runs the scripts. I have more important things to do than type.
August 23, 2011 at 4:09 pm |
Well Brad, try reading about it first then you might learn why it is this way.
October 24, 2011 at 8:17 am |
Steam Key kaufen…
[...]The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. « mosoto’s Weblog[...]…
October 29, 2011 at 6:30 pm |
satellite TV…
[...]The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. « mosoto’s Weblog[...]…
November 11, 2011 at 3:30 pm |
scriptmafia…
[...]The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. « mosoto’s Weblog[...]…
November 21, 2011 at 11:41 am |
Hi Mosoto Thanks, for the info, however, could you please help me to get this done. I am getting same error for the following -
PS C:\> Restore-SPSite -Identity http://sok1834:60000/ -Path “D:/Sibin/MS Solution/MS_Site_Backup/MS.bak”
The term ‘Restore-SPSite’ 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.
Thanks !!
December 3, 2011 at 4:19 am |
Hi msbuzzz, From my web search I found that Restore-SPSite is a sharepoint cmdlet. The most likely cause for your problem is not having the Sharepoint snapin loaded. The easiest solution is to try running the command in the sharepoint management shell. See
http://technet.microsoft.com/en-us/library/ee806878.aspx
Alternatively, you can load the snapin in the default PowerShell Window using hte add-pssnapin cmdlet. “Add-PSSnapin Microsoft.SharePoint.PowerShell”
You can see all the registered snapins by running “Get-PSSnapin -Registered”. Get-PSSnapin with no parameters will show you those snapins that are already loaded.
December 5, 2011 at 4:47 am
Thank you mosoto, That did the trick
December 3, 2011 at 5:00 am |
[...] long time ago I wrote a blog post about what I recognized as a very common error when starting to use PowerShell. You might have [...]
December 10, 2011 at 3:16 am |
Microsoft Outlook 2010 key…
[...]The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. « mosoto’s Weblog[...]…
January 9, 2012 at 12:39 am |
im getting this error… in visual studio 2010 package management console..
im in a hurry.. will anyone please help……………….. PLEASE
PM> Scaffold Controller post -Repository
The term ‘Scaffold’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check th
e spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:9
+ Scaffold <<<< Controller post -Repository
+ CategoryInfo : ObjectNotFound: (Scaffold:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
January 23, 2012 at 8:55 pm |
nyobaindotcom…
[...]The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. « mosoto’s Weblog[...]…