Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
914 views
in Technique[技术] by (71.8m points)

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

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?

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...