January 28th, 2021

New version of the PnP PowerShell – Open-source cross-platform PowerShell module to manage Microsoft 365

A few years in the making, but finally the day has come that we released PnP PowerShell for PowerShell 7. This is a big thing, because this makes the open-source PnP PowerShell cross-platform. It means that you can run PnP PowerShell on Windows, MacOS, Linux, Azure Functions, Azure Automation and in the Azure Cloud Shell. And yes, it even runs on a Raspberry Pi (we tested).

We were able to make it cross-platform as Microsoft released the SharePoint Client-Side Object Model (CSOM) for .NET Standard 2.0. And that means that we could recompile PnP PowerShell works on all the platforms mentioned above.

There are also some major differences. One of them is the way we authenticate. We know that most of use either used credentials or used the web login method to connect with Connect-PnPOnline. Now both ways of connecting make use of technology that is already pretty old and even on the list of things to be deprecated. For instance, authenticating with credentials already has been deprecated by Microsoft if you use CSOM for .NET Standard 2.0. So we moved over fully to OAuth2 based/Azure AD based authentication. There are some things to setup/consent to, but in the end you’ll have a way more robust way of authenticating. Check out the documentation on our website for more information about authenticating. Which brings us to the next topic.

A dedicated website

Together with the new release we also have a dedicated website: https://pnp.github.io/powershell. On this site you’ll find the documentation for all the cmdlets, articles and how-tos, and general information on how to start building the source code yourself. Of course this is all open for changes by the community. Actually it is much easier now to make changes to documentation for cmdlets, as we moved the whole documentation over to markdown format. Where you needed to be able to read C# code at least to do a documentation change, now the common skill of writing markdown is enough.

Nightly releases

We’ve been looking into our build processes and now we’re happy to announce that we release nightly builds! This means that if something gets fixed, you can get hold of an update a day later as during the night we do automatic builds which get published to the PowerShell Gallery. We still distribute major/minor releases which have been signed and all, but the nightly releases will surface as for instance 1.2.1-nightly. The last digit, the patch number, designate it’s a nightly. To install a nightly release, simply execute

Install-Module -Name PnP.PowerShell -AllowPrerelease

Any more changes?

Yes, some cmdlets have been renamed. Especially the ones around provisioning. We used a ‘non-approved’ verb previously (Apply-), and those have changed to ‘Invoke-‘. But we also renamed the [Verb]-ProvisioningTemplate cmdlets to [Verb]-SiteTemplate as it reflects that target of the template better. Then on top of those changes we added lots and lots of new cmdlets. Besides having almost all the functionality of the SharePoint Online Management Shell cmdlets (most of the time you simply have to replace -SPO with -PnP to get the cmdlet), we now support Planner, Microsoft Flow and Microsoft Teams besides SharePoint.

There are over 530 cmdlets today already!

All in all we are very excited about this release, as it opens so many new scenarios to use PnP PowerShell. Now, launch PowerShell, and enter:

Install-Module -Name PnP.PowerShell

Frequently asked questions

What’s the relation of this PowerShell module on the Microsoft Graph PowerShell SDK?

Microsoft Graph PowerShell SDK is a comprehensive module for managing different services in Microsoft 365. It is automatically generated based on the Microsoft Graph APIs and is frequently updated to cover all the matching supported capabilities as exposed in API level. It’s also operational specific, so there are cmdlets for all different CRUD operations which are available in the API platform. PnP PowerShell cmdlets are scenario based cmdlets which are not automatically generated from the code.

What’s the supportability story on the PnP PowerShell module?

All operations exposed as PnP PowerShell cmdlets are using externally exposed and supported APIs from Microsoft 365. PnP PowerShell is open-source, community driven initiative, supported by the community for the community.

 

The PnP PowerShell is an open-source project built by Microsoft together with our MVPs and community members. You are more than welcome to get more closely involved and please do let us know what’s needed on these areas.

“Sharing is caring!”


Microsoft 365 Patterns and Practice (PnP) – 28th of January

Author

We coordinate the Microsoft 365 Patterns and Practices (PnP) open-source and community activities.