Skip to main content

Not able to load Sharepoint online PowerShell module after installation

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

Popular posts from this blog

sorry we couldn't remove the app - SharePoint Online

Some time you try to remove some installed apps from SharePoint and it removes approx. all the time but some apps says " sorry we couldn't remove the app ". To remove these kind of apps, You have to use PowerShell Scripts. So there are some steps : 1. Install PnP PowerShell ( Click Here ) 2. Now run the following PnP command with URL and App Name changes : Connect-PnPOnline –Url <Your_Site_Collection_URL> –Credentials (Get-Credential) $instances = Get-PnPApp  $instance = $instances | where {$_.Title -eq '<My_App_Name'}   #Uninstall-PnPApp -Identity $instance.Id Remove-PnPApp -Identity $instance.Id

Export / Import from Excel file in SharePoint

SharePoint Web Part - Export or Import from Excel Here is the tool which will help you to import excel file into a list. This tool will not create any kind of list or column. It will help users to import their excel file in specific list. This tool also allows users to update existing records directly from excel file. I have develop the tool in SharePoint Framework. Currently this tool is for SharePoint Online version only. We are supporting following columns : Single line of text Multiple lines of text Number Yes/No Person or Group (Person + Group) Person or Group (Person + Group) (Allow multiple selections) Date and Time Choice Choice (Allow multiple selections) Hyperlink or Picture Currency Managed Metadata Managed Metadata (Allow multiple values) Lookup Lookup (Allow multiple values) Installation of App :- 1. Click here to download the sps-import-from-excel.sppkg . 2. Visit the Microsoft 365 SharePoint Admin Center 3. Go to Apps -> App Catalog. If you don't have ap...

Error while compiling spfx project - Error - typescript - node_modules/@fluentui/react-focus/node_modules

 Some when you create new project or upgrade existing project, developer get issues related to fluent ui packages i.e. : Error - typescript - node_modules/@fluentui/react-focus/node_modules/@uifabric/merge-styles/lib/DeepPartial.d.ts(4,26): error TS1005: ';' expected. Error - typescript - node_modules/@fluentui/react-focus/node_modules/@uifabric/merge-styles/lib/DeepPartial.d.ts(4,41): error TS1005: ')' expected. Error - typescript - node_modules/@fluentui/react-focus/node_modules/@uifabric/merge-styles/lib/DeepPartial.d.ts(4,42): error TS1005: ';' expected. Error - typescript - node_modules/@fluentui/react-focus/node_modules/@uifabric/merge-styles/lib/DeepPartial.d.ts(4,72): error TS1005: ';' expected. Error - typescript - node_modules/@fluentui/react-focus/node_modules/@uifabric/merge-styles/lib/DeepPartial.d.ts(4,107): error TS1005: '(' expected. Error - typescript - node_modules/@fluentui/react-focus/node_modules/@uifabric/merge-styles/lib/De...