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

$site = Get-SPSite -Identity $siteID

And I get the following error message:

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

So after some searches, Apparenty I have to add the following line:

Add-PSSnap in Microsoft.SharePoint.Powershell 

but when I run it, I get the following message: Add-PSSnapin: No snap-ins have been registered for Windows Powershell version 5

Any idea of what I'm doing wrong?

Thank you for help :)


Invalid syntax: Add-PSSnap in Microsoft.SharePoint.Powershell


if(!(Get-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction:SilentlyContinue))
Add-PSSnapin Microsoft.SharePoint.PowerShell 

Please make sure that you run the PowerShell on a SharePoint Server machine.

The PowerShell script below can get a list of snap-ins that are registered on your computer:

Get-PSSnapin –registered

More information about Add-PSSnapin

  • Thank you for your quick answer But I have the same error message: Add-PsSnapin : No snap-ins have been registered for Windows PowerShell version 5.
    – freedumz
    Feb 4 '19 at 8:14
  • get-pssnapin –registered docs.microsoft.com/ru-ru/powershell/module/…
    – Fox
    Feb 4 '19 at 8:15
  • get-pssnapin returns: Name: Microsoft.PowerShell.Core PsVersion :5.1.14393.2636 Description: This windows Powershell snap-im contains cmdlets used to manage components of Windows Powershell get-pssnapin-Registered returns nothing
    – freedumz
    Feb 4 '19 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.