Install/Update/Uninstall Cmdlets for SharePoint Online

Installing SharePoint cmdlets it’ll most likely be a requirement when you’re developing on SharePoint either Online or On-prem. In this article, we’ll explain how to install, update, check the current version and uninstall these PowerShell solutions.

To start, I’ll always recommend you install these cmdlets by PowerShell since will easier when there is an update because you don’t need to download the .msi.

Execution Policy

Get-ExecutionPolicy #Check the current ExecutionPolicy 
Set-ExecutionPolicy -ExecutionPolicy  Unrestricted

SharePoint Online Management Shell

Install:

 Install-Module -Name Microsoft.Online.SharePoint.PowerShell

Check the current version:

Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version

Update:

Update-Module -Name Microsoft.Online.SharePoint.PowerShell

Uninstall:

Uninstall-Module -Name Microsoft.Online.SharePoint.PowerShell

PnP PowerShell

Install:

Install-Module SharePointPnPPowerShellOnline -Force
#Force will force to install the latest version

Check the version:

Get-Module SharePointPnPPowerShellOnline -ListAvailable | Select-Object Name,Version | Sort-Object Version -Descending

Update:

Update-Module SharePointPnPPowerShellOnline

Uninstall

Uninstall-Module -Name SharePointPnPPowerShellOnline

References

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-6

https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/connect-sharepoint-online?view=sharepoint-ps

https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *