Office 365: Getting started with SharePoint PnP PowerShell - installation

Best way to Install PnP PowerShell SharePoint Online: Getting started with SharePoint PnP PowerShell – Microsoft 365

2 comments

 108,099 total views,  1 views today

Learn SharePoint Online from the Pr...
Learn SharePoint Online from the Pros

In this “Install PnP PowerShell SharePoint Online” tutorial, we will learn how to install PnP PowerShell in SharePoint Online.

PnP PowerShell overview: Get started with SharePoint PnP PowerShell

The SharePoint Patterns and Practices – short name PnP is a collection library that contains an array of PowerShell commands – named PnP PowerShell which allows us(SharePoint administrator or developer) to perform complex provisioning and artifact management actions in SharePoint.

The PnP PowerShell is built on the SharePoint CSOM PowerShell framework – which can work against both the SharePoint Online and SharePoint On-Premises(SharePoint 2019, SharePoint 2016, SharePoint 2013).

There are so many ways to install the SharePoint PnP Powershell, This is one of the approaches for installation on machines that have at least PowerShell v3 installed.

Check Powershell version: Verify which version of PowerShell is installed on the machine

We can find the version of PowerShell by opening PowerShell and running $PSVersionTable.PSVersion. In this result of command – the major version should be above 3.

SharePoint PnP Powershell installation - Install-Module SharePointPnPPowerShellOnline
SharePoint PnP Powershell installation – Install-Module SharePointPnPPowerShellOnline

To install the “SharePointPnPPowerShellOnline” we need to run the below PowerShell command which will install PowerShell Package Management and then install the PowerShell Modules from the PowerShell Gallery. 

(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/sharepoint/PnP-PowerShell/master/Samples/Modules.Install/Install-SharePointPnPPowerShell.ps1')

Install PnP PowerShell SharePoint Online – command example

The above command execution example:

SharePoint PnP Powershell installation - Install-Module SharePointPnPPowerShellOnline - script execution
SharePoint PnP Powershell installation – Install-Module SharePointPnPPowerShellOnline

Notes:

If we have OS windows 10 machine – we can run the below command directly from SharePoint Online Management Shell:

  • SharePoint Online: Install-Module SharePointPnPPowerShellOnline
  • SharePoint 2016: Install-Module SharePointPnPPowerShell2016
  • SharePoint 2013: Install-Module SharePointPnPPowerShell2013

The above points explained which command should be executed in which version of SharePoint.

If the SharePointPnPPowerShellOnline module is not installed in the machine properly and try to execute the Connect-PnPOnline command, we will get the below error:

Connect-PnPOnline : The term ‘Connect-PnPOnline’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Connect-PnPOnline + ~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Connect-PnPOnline:String) [], C ommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Summary: SharePoint PnP PowerShell install (get started with SharePoint PnP PowerShell)

Thus, in this article we have learned the below topics:

  • Overview of PnP PowerShell.
  • How to install the SharePointPnPPowerShellOnline module using a script.
  • How to Install-Module SharePointPnPPowerShellOnline in SharePoint Online.
  • How to Install-Module SharePointPnPPowerShell2016 in SharePoint 2016.
  • How to Install-Module SharePointPnPPowerShell2013 in SharePoint 2013.
  • How to fix “the term ‘Connect-PnPOnline’ is not recognized as the name of a cmdlet, function”

See Also: PnP PowerShell (SharePoint PowerShell tutorial)

You may also like the following SharePoint PowerShell tutorials:

PDF Download Image

Download SharePoint Online & Office 365 Administration eBook

Buy the premium version of SharePoint Online & Office 365 administration eBook from here:



Buy SharePoint Online & Office 365 Administration eBook


 

Get the free demo PDF eBook from here:

FREE DOWNLOAD

Send download link to:

Subscribe to get exclusive content and recommendations every month. You can unsubscribe anytime.

 

About Post Author

2 comments on “Best way to Install PnP PowerShell SharePoint Online: Getting started with SharePoint PnP PowerShell – Microsoft 365”

Do you have a better solution or question on this topic? Please leave a comment