The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.

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.)

Advertisement

19 Responses to “The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.”

  1. Powershell: Cannot run EXE. The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. « Bite The Wax Tadpole Says:

    [...] 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. [...]

  2. Sean Says:

    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?

  3. Idiot Says:

    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!

  4. PowerShell: the 2 most common error messages for starters « The Wiert Corner – irregular stream of Wiert stuff Says:

    [...] message by mosoto (Marcel J. Ortiz Soto) answered this as one of the first in the search results for “is not [...]

  5. Workflow 4.0 « Dead Code Says:

    [...] 4.http://mosoto.wordpress.com/2008/09/20/the-term-is-not-recognized-as-a-cmdlet-function-operable-prog… [...]

  6. tory burch sale outlet Says:

    so great post for me, thank you very much

  7. windows Says:

    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…

  8. Brad Says:

    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.

  9. Phil Says:

    Well Brad, try reading about it first then you might learn why it is this way.

  10. Steam Key kaufen Says:

    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[...]…

  11. satellite TV Says:

    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[...]…

  12. scriptmafia Says:

    scriptmafia…

    [...]The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. « mosoto’s Weblog[...]…

  13. msbuzzz Says:

    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 !!

    • mosoto Says:

      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.

  14. The term is not recognized as the name of a cmdlet « mosoto’s Weblog Says:

    [...] 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 [...]

  15. Microsoft Outlook 2010 key Says:

    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[...]…

  16. greyzeeeeeeeee Says:

    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

  17. nyobaindotcom Says:

    nyobaindotcom…

    [...]The term is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. « mosoto’s Weblog[...]…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.