Replies: 3 comments 10 replies
-
You might have currently another module loaded that uses a different version of this assembly. To check if a version is currently loaded in PowerShell: [System.AppDomain]::CurrentDomain.GetAssemblies() | Where-Object{$_.Location -like "*Microsoft.Online.SharePoint.Client.Tenant*"} Both Microsoft.Online.SharePoint.PowerShell (e.g. SharePoint Online Management Shell) and PnP PowerShell (both the legacy and the current version) refere to this assembly? Maybe you still have the older version of PnP PowerShell installed? To update the SharePoint Online Management Shell to the latest version: Update-Module -Name Microsoft.Online.SharePoint.PowerShell To uninstall the legacy version of PnP PowerShell: Uninstall-Module -Name SharePointPnPPowerShellOnline -AllVersions -Force |
Beta Was this translation helpful? Give feedback.
-
We're a bit puzzled about the version included with Microsoft.SharePointOnline.PowerShell. That version is actually not targeting SharePoint Online, it's the build for SP 2016. We are including version 16.1.* in our builds, which is always the latest. I just tried on my machine by opening PS5, then loading Connect-SPOService (which will load the Microsoft.Online.SharePoint.Client.Tenant.dll assembly into the current appdomain). Then I used Connect-PnPOnline and received no error message. When checking the appdomain I noticed that both versions of the Microsoft.Online.SharePoint.Client.Tenant assemblies where loaded. Can you uninstall SharePointPnPPowerShellOnline and try again? |
Beta Was this translation helpful? Give feedback.
-
Hi, I've just followed the instructions on upgrading from the Legacy version of PnP PowerShell (https://pnp.github.io/powershell/articles/upgrading.html) and - after uninstalling SharePointPnPPowerShellOnline and installing PnP.PowerShell - had a similar issue:
I only have windows powershell installed on my windows 10 system (PSVersion = 5.1.19041.610). Any idea on how to solve this? |
Beta Was this translation helpful? Give feedback.
-
Import-Module PnP.PowerShell
Import-Module: Could not load file or assembly 'Microsoft.Online.SharePoint.Client.Tenant, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. Could not find or load a specific file. (0x80131621)
Hello I recently installed PowerShell 7.1.0 and then installed the recent version of PnP.PowerShell
Name Value
PSVersion 7.1.0
PSEdition Core
GitCommitId 7.1.0
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Install-Module -Name PnP.PowerShell -AllowPrerelease
However, when I attempt to import the module for PnP.PowerShell it throws errors.
Is anyone willing to give me some hints or tips about what I have done wrong or what I have not done that I need to do to be able to get PnP.PowerShell to successfully work.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions