I try to get the snapin "Microsoft.SharePoint.PowerShell" in Powershell but i get an error.

Add-PSSnaping : no snap-ins have been registered for Windows PowerShell version 5

How can I solve this?

2 Answers 2


You can use the PowerShell Gallery module which can be installed on a per-user basis. This is the preferred installation over the MSI method.


Looks like you are running the powershell on a machine where SharePoint is not installed. You can check by running below command if that snap-in available or not?

get-pssnapin –registered

Try to run the PowerShell on the server where SharePoint is installed.

If you want to run it from pc then you try this workaround: How to add Add-PSSnapin Microsoft.SharePoint.PowerShell to machine without SharePoint

If you want to use the SPO management then follow the instruction here: Getting started with SharePoint Online Management Shell

  • I want to connect to SharePoint-Online with powershell. The command get-pssnapin -registered gives me nothing. So I guess nothing Is registered
    – user78519
    Jan 16, 2019 at 22:23
  • check the updated answer for SPO shell configuration
    – Waqas Sarwar MVP
    Jan 16, 2019 at 22:25
  • And I want to use the Powershell ISE and not the sharepoint online management shell
    – user78519
    Jan 16, 2019 at 22:28
  • You have to import to import the modules inside the ISE. something like Import-Module Microsoft.Online.SharePoint.Powershell -Verbose
    – Waqas Sarwar MVP
    Jan 16, 2019 at 22:32
  • Get the error: Import-Module : The specified module 'Microsoft.Online.SharePoint.Powershell' was not loaded because no valid module file was found in any module directory.
    – user78519
    Jan 16, 2019 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.