0

I have two versions of PnP PowerShell loaded on my machine:

SharePointPnPPowerShell2013   3.11.1907.0
SharePointPnPPowerShellOnline 3.1.1809.0

I'm having issues running code against SharePoint 2013. How do I specify which version of PnP PowerShell executes my code? I'm thinking the issue is I'm running the Online version rather than the 2013 version?

Thanks!

0

you can do below

Run them side by side Out of the box this won't work.

Well, you can install them, but PowerShell will automatically load the first one it finds. So in order to use them we will have to do some tweaking.

Make sure that you have uninstalled all instances of PnP Powershell that you currently have available on your machine. If you installed it previously using install-module, simply use uninstall-module -Name SharePointPnPPowerShell -AllVersions.

Now download all of the modules to a location that you are aware off, say you created a folder called c:\bin\pnppowershell

Use the following commands to download them:

Save-Module -Name SharePointPnPPowerShell2013 -Path c:\bin\pnppowershell
Save-Module -Name SharePointPnPPowerShell2016 -Path c:\bin\pnppowershell
Save-Module -Name SharePointPnPPowerShellOnline -Path c:\bin\pnppowershell

From now on, if you want to use a specific version of PnP PowerShell, you will have to manually import them (make sure to replace the version number with your current version):

import-module C:\bin\pnppowershell\SharePointPnPPowerShell2013\2.24.1803.0\sharepointpnppowershell2013.psd1 -DisableNameChecking

Answer directly copied from below link.

https://www.erwinmcm.com/running-the-various-versions-of-pnp-powershell-side-by-side/

0

I found a great post that resolves this: http://blogold.pixelmill.com/3718/running-multiple-versions-of-pnp-powershell/

To find out what version of Pnp PowerShell you are currently running:

Get-Module

To switch to another version:

Import-Module SharePointPnPPowerShell2013

or

Import-Module SharePointPnPPowerShellOnline

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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