Can we import SharePoint Online PnP powershell module in PowerShell Core 6.0 and use the cmdlets? I tried Connect-PnPOnline and I get the below error:

The type initializer for 'Microsoft.SharePoint.Client.ClientContextExtensions' threw an exception.

  • what about nowaday? > Connect-PnPOnline: The remote server returned an error: (400) Bad > Request. > Connect-PnPOnline: The type initializer for > 'OfficeDevPnP.Core.Utilities.TokenHelper' threw an exception. Oct 8, 2020 at 7:29

1 Answer 1


Unfortunately, the answer is no at the moment.

PowerShell Core 6.0 is built on top of .NET Core 2.0 runtime. But the thing is, PnP PowerShell depends on PnP CSOM Core components which are dependent on SharePoint CSOM libraries. Now, SharePoint CSOM libraries are dependent internally on some "other" libraries which are, as yet, not compatible with .NET Core.

Once, the CSOM libraries are ported or made compatible with .NET Core, we will be able to use it in PowerShell Core 6.0 and above.

Uservoice - Support .NET core with CSOM

There is this uservoice link where Microsoft has mentioned that they are looking into this thibg but has no ETA mentioned.

Also, I am assuming that you need to "do something cross-platform" , on a non-windows machine, if so, I would suggest that you take a look at Office365-cli using which you manage any Office 365 tenant from any platform. Currently, the commands available are limited compared to PnP PowerShell but its growing quite fast. Office 365 cli internally calls the RESTful API endpoints which are platform agnostic.

References - Office365-cli

Managing Office 365 on any platform

Office 365 comparison with SPO and PnP PowerShell

  • CSOM on .NET Core seems to be supported now (see UserVoice); still waiting for PnP PowerShell on PS Core Sep 29, 2020 at 11:35
  • 1
    Coming very soon :) Sep 29, 2020 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.