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.

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:

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:
- Office 365: How to create content type in SharePoint Online using PowerShell?
- Office 365: How to create document library in SharePoint Online using PowerShell?
- Export SharePoint user information list to CSV(Excel) file using PowerShell
- How to fix “The term ‘Get-MsolUser’ is not recognized as the name of a cmdlet”
- How to fix the “The term ‘Get-SPWeb’ is not recognized as the name of a cmdlet, function” PowerShell error
- How to hide quick launch menu in SharePoint online using PnP PowerShell
- Edit user Permission is greyed Out SharePoint Online
- Get workflow inventory from SharePoint online using PowerShell CSOM
- Create a modern team site using PnP PowerShell in SharePoint
- In 2 steps convert a classic SharePoint page to modern using PnP
- SharePoint Online: Delete All Files from document library for the given date – PowerShell CSOM
- Create SharePoint online list using PnP provisioning template
- SharePoint Automation: PowerShell script to get remote server information
- Office 365: Retrieve hub sites and associated sites using PnP Powershell
- SharePoint Online Automation – O365 – Upload files to document library using PowerShell CSOM
- SharePoint Online Automation – O365 – Create multiple items in a list using PowerShell CSOM
- SharePoint Online Automation – O365 – Update document library metadata using PowerShell CSOM
- PnP PowerShell from GitHub.

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