This solution contains a library of PowerShell commands that allows you to perform complex provisioning and artifact management actions towards SharePoint. The commands use a combination of CSOM and REST behind the scenes, and can work against both SharePoint Online as SharePoint On-Premises.
- Office 365 Multi Tenant (MT)
- Office 365 Dedicated (D)
- SharePoint 2013 on-premises
- SharePoint 2016 on-premises
- SharePoint 2019 on-premises
In order to generate the Cmdlet help you need to have Windows Management Framework installed.
If it is not pre-installed on your operating system, you can find installation instructions in the WMF release notes.
Solution | Author(s) |
---|---|
SharePointPnP.PowerShell | Erwin van Hunen and countless community contributors |
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
Navigate here for an overview of all cmdlets and their parameters
There are 2 ways to install the cmdlets. We recommend, where possible, to install them from the PowerShell Gallery. Check out the "Getting Started with the Gallery" section to make sure you have all requirements in place. Alternatively you can download the setup files and install the cmdlets directly.
If you main OS is Windows 10, or if you have PowerShellGet installed, you can run the following commands to install the PowerShell cmdlets:
SharePoint Version | Command to install |
---|---|
SharePoint Online | Install-Module SharePointPnPPowerShellOnline |
SharePoint 2019 | Install-Module SharePointPnPPowerShell2019 |
SharePoint 2016 | Install-Module SharePointPnPPowerShell2016 |
SharePoint 2013 | Install-Module SharePointPnPPowerShell2013 |
Notice: if you install the latest PowerShellGet from Github, you might receive an error message stating
PackageManagement\Install-Package : The version 'x.x.x.x' of the module 'SharePointPnPPowerShellOnline' being installed is not catalog signed.
In order to install the cmdlets when you get this error specify the -SkipPublisherCheck switch with the Install-Module cmdlet, e.g. Install-Module SharePointPnPPowerShellOnline -SkipPublisherCheck -AllowClobber
You can download the setup files from the releases section of the PnP PowerShell repository. These files will up be updated on a monthly basis. Run the install and restart any open instances of PowerShell to use the cmdlets.