How to upgrade to PowerShell 7 and PnP Powershell

January 11, 2021

So like everyone knows PnP Powershell is being rewritten from .net 4.6.1 to .net 2.0 standard. Bad news is that the current powershell that comes with windows 10 won’t be supported anymore, good news? Powershell 7 and multi OS support, which means you can use PnP and PowerShell on OSX and Linux. :D

So what’s needed ?

Well first we need to download the package for PowerShell 7 from their github:,

https://github.com/PowerShell/PowerShell/releases/

https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7.

Download the PowerShell-7.X.X-XXX-win-x64.msi Just to make it easier to install :)

powershell install 1

powershell install

After this let’s start PowerShell 7 and build the new PnP Module! :D

powershell 7

Let’s download the PnP powershell from their github:

https://github.com/pnp/powershell

To make it easy for us let’s just download from releases using github, this way I can use git to fetch new changes and build the module :)

Start PowerShell 7 and run this line of code:

 Install-Module -Name "PnP.PowerShell" -AllowPrerelease  -AllowClobber

install pnppowershell

Now that PnP powershell is installed, we need to configure it to authenticate with Azure/M365

https://pnp.github.io/powershell/articles/authentication.html

Run:

 Register-PnPManagementShellAccess

loginpromt

permissions pnp

Accept the permissions and then you can start using your PnP powershell as usual :)

Resource:

https://pnp.github.io/powershell/index.html


Your Modern Workplace

© 2020 Nicolas Kheirallah