I did installation of SharePoint Online PowerShell Module but it was throwing error when I was using it :
Error Detail:
[PS] C:\Windows\system32>Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
Import-Module : Could not load type 'Microsoft.Online.SharePoint.TenantAdministration.SPOTenantCdnType' from assembly
'Microsoft.Online.SharePoint.Client.Tenant, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.
At line:1 char:1
+ Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChec ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Module], TypeLoadException
+ FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand
I verified that the module is installed:
[PS] C:\Windows\system32>Get-Module -ListAvailable -Name "Microsoft.Online.SharePoint.PowerShell" | ft version, name
Version Name
------- ----
16.0.20017.12000 Microsoft.Online.SharePoint.PowerShell
-------------------------------------------------------------------------------------------------------------------------
Solution:
To resolve the issue,
(1) Navigate to C:\Windows\Microsoft.NET\assembly\GAC_MSIL
(2) Remove the Microsoft.SharePoint.* assemblies
(3) Uninstall the module with Uninstall-Module -Name Microsoft.Online.SharePoint.PowerShell
(4) Install Module from PowerShell Gallery :
Here is the command :
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -RequiredVersion 16.0.20414.12000
Now it is working fine.
Comments
Post a Comment