How to Run Any Version of PnP.PowerShell Without Installation: A Step-by-Step Guide

Posted by

Discover how to run any version of PnP.PowerShell without installation! This guide walks you through downloading, extracting, and importing specific PnP versions manually, enabling you to test scripts with different PowerShell requirements seamlessly and efficiently. Unique :

Run Any Version of PnP PowerShell Without Installation

If you’re a PowerShell enthusiast or a SharePoint pro, you know how tricky managing different versions of PnP.PowerShell can be. Sometimes, your scripts need a newer or older version than what’s installed on your machine. Luckily, Microsoft has a neat way to run any PnP version without installing it. Let’s dive into how you can do this efficiently.

What’s New?

The latest method allows you to manually download and run any PnP.PowerShell version directly from the PowerShell Gallery. No installation needed! This is especially useful when testing scripts that rely on deprecated or newly introduced features.

“Success!!! You have loaded your desired version of PNP, Great Job!!!” – mikeleemsft, Microsoft

Major Updates and Requirements

Before jumping in, note the PowerShell version requirements for different PnP.PowerShell releases:

  • PnP.PowerShell 0 requires PowerShell 5.1 or higher.
  • Version 0 needs PowerShell 7.2 or higher.
  • Version 3.0+ demands PowerShell 7.4 or above.

If you’re still on Windows PowerShell 5.x, you’ll need to upgrade to PowerShell 7.x. Microsoft’s official docs provide a quick guide to install it.

Step-by-Step: Running PnP Without Installation

  1. Head to the PnP.PowerShell Gallery and pick your desired version.
  2. Expand the file list and choose “Manual Download” to grab the raw .nupkg file.
  3. Move the downloaded file to a clean folder, e.g., C:\temp\pnp.powershell.version.
  4. Rename the file extension from .nupkg to .zip and extract it.
  5. Open PowerShell 7.x as Administrator and navigate to the extracted folder.
  6. Run Import-Module .\PnP.PowerShell.psd1. If you hit a signature error, set your execution policy to unrestricted with Set-ExecutionPolicy Unrestricted.
  7. Verify the module loaded using Get-Module -Name "PnP.PowerShell".
“Now you are free to use PNP commands that are included with the targeted version of PNP, without installing the module.” – mikeleemsft, Microsoft

Testing Your Setup

To confirm everything works, register a new PnP app for interactive login:

Register-PnPEntraIDAppForInteractiveLogin -ApplicationName "PNPAPP" -Tenant yourtenant.onmicrosoft.com

Then connect using:

Connect-PnPOnline -Url "https://yourtenant-admin.sharepoint.com" -ClientId 'your-client-id' -Interactive

After logging in, you can run PnP commands from your chosen version without any installation hassles.

Why This Matters

This approach saves time and avoids version conflicts. Developers and admins can quickly test scripts across multiple PnP versions without cluttering their systems.

In short, this manual download and import method is a game-changer for PowerShell users working with SharePoint and Microsoft 365 automation.

  • Identify PowerShell version requirements for PnP.PowerShell versions 0, 0, and 3.0.
  • Download the desired PnP.PowerShell version’s raw “nupkg” file from the PowerShell Gallery.
  • Rename the downloaded file to .zip and extract it to a preferred folder.
  • Use PowerShell 7.x as an administrator to import the PnP module without installation.
  • Handle execution policy errors by setting it to Unrestricted for unsigned nightly builds.
  • From the New blog articles in Microsoft Community Hub



    Related Posts
    Unlock New Possibilities with Windows Server Devices in Intune!

      Windows Server Devices Now Recognized as a New OS in Intune Microsoft has announced that Windows Server devices are Read more

    Unlock the Power of the Platform: Your Guide to Power Platform at Microsoft Ignite 2022

    Microsoft Power Platform is leading the way in AI-generated low-code app development. With the help of AI, users can quickly Read more

    Unlock the Power of Microsoft Intune with the 2210 October Edition!

    Microsoft Intune is an enterprise mobility management platform that helps organizations manage mobile devices, applications, and data. The October edition Read more

    Unlock the Power of Intune 2.211: What’s New for November!

    Microsoft Intune has released its November edition, featuring new updates to help IT admins better manage their organization’s mobile devices. Read more