Powershell Error "The term 'Get-SPWeb' is not recognized as the name of a cmdlet, function..."

LifeScript picture LifeScript · Jun 20, 2012 · Viewed 124.3k times · Source

I just typed the follow to try and get my SharePoint site:

$spWeb = Get-SPWeb -Identity "http://nycs00058260/sites/usitp"

It gave me the following error

The term 'Get-SPWeb' is not recognized as the name of a cmdlet, function, script...

The url is correct so why am I getting this error?

Answer

nimizen picture nimizen · Jun 20, 2012

I think this need to be run from the Management Shell rather than the console, it sounds like the module isn't being imported into the Powershell console. You can add the module by running:

Add-PSSnapin Microsoft.Sharepoint.Powershell

in the Powershell console.