Powershell Error “The term 'Get-SPWeb' is not recognized as the name of a cmdlet, function…”

☆樱花仙子☆ 提交于 2019-11-30 11:46:35

问题


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?


回答1:


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.




回答2:


Run this script from SharePoint 2010 Management Shell as Administrator.




回答3:


Instead of Windows PowerShell, find the item in the Start Menu called SharePoint 2013 Management Shell:



来源:https://stackoverflow.com/questions/11122585/powershell-error-the-term-get-spweb-is-not-recognized-as-the-name-of-a-cmdlet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!