When I import the SharePoint Online PowerShell module in PowerShell console, I am getting the error “Import-Module : The specified module ‘Microsoft.Online.SharePoint.PowerShell’ was not loaded“.
Import Module Command:
PS C:> Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
Error:
Import-Module : The specified module 'Microsoft.Online.SharePoint.PowerShell' was not loaded because no valid module file was found in any module directory. At line:1 char:1 + Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (Microsoft.Online.SharePoint.PowerShell:String) [Import-Module], FileNotFoundException + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Fix/Solution:
The problem was solved for me after running the PowerShell console with elevated privilege (Run as administrator).
Advertisement