Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Using custom PnP PowerShell builds

Koen Zomers edited this page Jun 30, 2020 · 4 revisions

Frequently when opening an issue you may find that someone looking into your issue report will create a fix in PnP PowerShell to resolve the issue you are reporting. That typically means that in the next PnP PowerShell monthly release, occurring in the first or second week of a calendar month, the fix would be included in the official release. In cases where you would like to validate if it really fixes the issue on your machine or simply can't wait for the next monthly release, a custom PnP PowerShell build containing the fix could be useful. Follow the steps below if you want to do this.

If you're not a developer

If you're not a developer and no custom build has been offered yet in the issue topic you're working in, request the person working on the issue to create a custom build for you. Once the person has made this available for download in that same issue topic, you can proceed with the following steps to start using it:

  1. Ensure PnP PowerShell is installed on the machine where you intend to use/try the custom build. Use the normal Install-Module SharePointPnPPowerShellOnline option to install the latest official release, if it's not available on that machine for the current user yet.
  2. Run the following line of PowerShell in a PowerShell window to find out where the PnP PowerShell files are located:
Get-Module -ListAvailable SharePointPnPPowerShellOnline | Select Version, Path | fl
  1. Ensure you continue in a PowerShell session which does not yet have PnP PowerShell loaded in it. If you're unsure, just open a new PowerShell window and continue in that session.
  2. Download the custom build from the issue topic and extract the files over the existing files located in the Path shown in the previous output. Note that the path contains the full path to the .psd1 file. Cut off SharePointPnPPowerShellOnline.psd1 from this path to get to the folder where you need to extract the files from the custom build overwriting any existing files in that folder. Typically, on a Windows machine, this would be C:\Users\<username>\Documents\WindowsPowerShell\Modules\SharePointPnPPowerShellOnline
  3. Make sure the files do not have the block attribute set as they've been downloaded from the internet. You can unblock all of them by running the following PowerShell:
Get-ChildItem | Unblock-File
  1. Just to be sure that you're using the right PnP PowerShell module, run the following PowerShell line to load the PnP PowerShell module:
Import-Module SharePointPnPPowerShellOnline
  1. You can now execute your PnP PowerShell based cmdlets as normal and the custom build will be applied.

If you're a developer

If you're a developer and familiar with GitHub, you can simply compile a custom build yourself. In the issue topic where your issue is being discussed, you will most often find a reference to the Pull Request (PR) in which the issue has been fixed. Click on that link to jump to that PR. At the top of the PR page you fill find something like:

<GitHub user> wants to merge <X> commits into pnp:dev from <GitHub user>:<Branchname>

Click on the <GitHub user>:<Branchname> part and use the green Clone button to clone a local copy or download it. Open it in Visual Studio and build it as you normally do for PnP PowerShell and you'll have the version running which includes the fix.

Reverting to normal build

Once you're done testing and would like to revert to the normal official PnP PowerShell release, easiest way to do so is to just reinstall the PnP PowerShell module:

Uninstall-Module SharePointPnPPowerShellOnline
Install-Module SharePointPnPPowerShellOnline