Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > The new PnP.PowerShell Module is live!
January 19
The new PnP.PowerShell Module is live!

As of January 19th, 2021 the new and improved PnP.PowerShell module is no longer prerelease and is ready for the masses. You can also find it in a GitHub repo. It replaces the venerable SharePointPnPPowerShellOnline module we all know and love. The new module has a lot changes, but here are a few of the highlights:

  • PnP.PowerShell only works with online products like SharePoint Online and Microsoft 365. It does not work with SharePoint Server platforms like SharePoint 2013, 2016, or 2019.
  • It is built on .NET core 3.1 so it runs on non Windows platforms like Linux, Mac, and Azure Functions. SharePointPnPPowerShellOnline is built on .NET 4.6.1 and only runs on Windows.
  • PnP.PowerShell is focused on all of Microsoft 365, not just SharePoint. SharePointPnPPowerShellOnline started out focused on SharePoint and other things have snuck in over the years, but were never supported as well as we would have liked.
  • Authentication relies on App Registrations. To facilitate the cross application support the module relies on Graph API permissions as opposed to straight up usernames and passwords. SharePointPnPPowerShellOnline uses App Registrations as well, but it’s not built on that premise like PnP.PowerShell is.

If you can, you should uninstall the SharePointPnPPowerShellOnline module and install PnP.PowerShell everywhere. You should also stop using Windows PowerShell 5.1 and move over to PowerShell 7.x. There are a couple of legit reasons why you can’t though. I have a whole blog post, “Using both PnP PowerShell Modules with PowerShell 5 and PowerShell 7” that covers how to have both modules and both shells available to you. For those of you with short attention spaces I’ll give you the tl;dr:

Open PowerShell 7.x in Administrator mode and uninstall all the modules:

Uninstall-Module SharePointPnPPowerShellOnline -Force –AllVersions
Uninstall-Module PnP.PowerShell -Force –AllVersions

That should clear all the appropriate modules out of PowerShell 7.x. You’re good there.

Now open Windows PowerShell 5.1 in Administrator mode. Here you’ll uninstall all the modules and reinstall them:

Uninstall-Module SharePointPnPPowerShellOnline -Force –AllVersions
Uninstall-Module PnP.PowerShell -Force –AllVersions

For good measure I close down the Windows PowerShell 5.1 host and open a new one before I install the new version. That might not be necessary, but it feels like cheap insurance. Either way, in a Windows PowerShell 5.1 Administrator shell install both modules:

Install-Module -Name SharePointPnPPowerShellOnline -Scope Allusers
Install-Module -Name PnP.PowerShell -Scope Allusers –AllowClobber

I added a little chocolate to the install commands to make them go down easier. First, I added -Scope Allusers to make sure Windows PowerShell 5.1 installs the module in a place that PowerShell 7.x can find it. I think any modules installed in an Admin window are installed there by default, but I’m not sure. Again, cheap insurance. Second, to the second (and any subsequent) module I added –AllowClobber. This tells PowerShell that it’s okay to install a module that has cmdlets that collide with cmdlets already on the system. This is okay because of the difference between installing a module and importing a module. You can read more about that in my previous post.

If you need one of the on-prem SharePoint Server modules use a line like this:

Install-Module -Name SharePointPnPPowerShell2019 -Scope Allusers –AllowClobber

You can have as many of these modules installed as long as you install the later ones with –AllowClobber.

Once you’ve got the modules installed you need to tell PowerShell which one to load. That’s done with the Import-Module cmdlet. When you open a new PowerShell window, or at the top of any PowerShell scripts, you can specify which PnP Module you want PowerShell to use. For instance:

Import-Module PnP.PowerShell

or

Import-Module SharePointPnPPowerShellOnline

or

Import-Module SharePointPnPPowerShell2019

Then you know you’ll get the version of Connect-PnPOnline (or whatever) your code is running.  In theory you could swap them in and out by using Remove-Module, but in reality there are some fiddley PowerShell things in the background (the AppDomain) that keeps this from being successful. My previous blog post does show you how to have multiple versions of the PnP module imported in the same window or script at the same time.

But really, stick to PnP.PowerShell and PowerShell 7 if humanly possible. Smile

I hope you find that all helpful. I don’t know about you, but I’m really excited about this new module.

tk

ShortURL: https://www.toddklindt.com/PoshNewPnPModule


Comments

russian call girls in lahore

This is the ideal spot to be looking for intimate sexual relationships with Lahore women on the phone. Our beautiful, hot women are friendly and willing to participate in sexual activity of any type to make their customers smile and feel content. The ladies who are on WhatsApp are always ready to talk at any time, regardless of what you'd like to learn more about. They're eager to wow customers with their stunning moves—some of their most impressive activities.
https://callgirlsinlahores.online/call-girls-in-lahore/
 on 10/3/2023 5:53 AM

female escorts

We have the most beautiful women Call Girls in Islamabad who are committed to the field of sexuality and are renowned in their area because of their efforts. Our explicit and sexually explicit call girls are 100% committed to satisfaction with you. Our beautiful girls will ignite your passion and passion and bring you the feeling of joy. Their expertise and experience will help you reach that next stage of pleasure.
https://islamabadbabes.online/
 on 10/3/2023 5:53 AM

call girl karachi 2023

Escorts are available to hire in Karachi. We are always looking for experienced and skilled staff. The main reason to employ this type of girl is the fact that you can use her present at any gathering you wish. This could mean the setting of a meeting for business or a group of friends. She's sure to make an impression in any group. It's not just because of her style. But she's at the forefront of the latest trends. Escorts from outside Karachi are able to attend any gathering. You'll be thrilled to have someone to share the experience at a third of the price. This is why choosing Karachi Call Girls is crucial because we provide services for escorting and are regarded as 100% authentic.

https://karachidarling.online/call-girls-in-karachi/
 on 10/3/2023 5:53 AM

Re: The new PnP.PowerShell Module is live!

Looking for virtual assistant jobs https://praemando.com? Join Praemando's team of skilled assistants and be part of a dynamic environment that values your expertise.
 on 10/5/2023 7:44 AM

Re: The new PnP.PowerShell Module is live!

At D&M Discount Realty, we have a team of highly skilled and experienced Best real estate agents in Cedar City https://cedarcityrealestate.com/ market. Our agents are not only knowledgeable about the area's real estate trends but also have a deep understanding of the local communities. Whether you are buying or selling, our agents will work tirelessly to ensure a smooth and successful transaction.
 on 10/5/2023 7:56 AM

Re: The new PnP.PowerShell Module is live!

Transform Your Workspace with Garages & WorkShops – Your Ultimate Resource for Garage Openers, Garage Organization, and More. Learn more now!Garage Organization https://telegra.ph/Elevate-Your-Garage-and-Workshop-with-Expert-Reviews-at-Garages--WorkShops-10-08
 on 10/8/2023 3:04 AM

Re: The new PnP.PowerShell Module is live!

This kind of is a wonderful submit My partner and i noticed as a result of discuss that. It is just what I desired to find out desire inside upcoming you may keep on regarding revealing this kind of outstanding submit.UFABETเว็บแทงบอลถูกกฏหมาย https://ljpelectrician.com/ufabetเว็บแทงบอลถูกกฏหมาย/
 on 10/10/2023 7:31 AM

asa

Cool Air Tech is your go-to Anaheim Air Conditioning Repair provider since 1996. With a team of factory-trained, certified HVAC contractors, we offer top-notch services, sales, and repairs. Explore our website to learn more.Air Conditioning Services Anaheim https://www.click4r.com/posts/g/12336582/
 on 10/16/2023 2:10 AM

Re: The new PnP.PowerShell Module is live!

Explore the solaredge vs enphase https://www.thepowerproject.io/blog/solaredge-inverters-vs-enphase-micro-inverters-an-in-depth-comparison-for-2023 showdown for 2023! Our experts dissect the differences in solar inverters, helping you choose the right one for your home. Click here to learn more.
 on 10/17/2023 1:47 AM

Re: The new PnP.PowerShell Module is live!

Welcome to Been There Financial Planning, an independent and fee-only VB, Ontario. We offer unbiased financial advice and transparent pricing to help you achieve your financial goals. Schedule a free 30-minute meeting with our experienced planner today!
 on 10/17/2023 3:27 AM
1 - 10Next

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person

Twitter


Want a message when I reply to your comment? Put your Twitter handle here.

Attachments

 

 SysKit