The specified module ‘MSOnline’ was not loaded.

KB ID 0001637

Problem

I was trying to do some Azure Powershell this morning, I’d executed a Connect-MsolService command and got a;

The term ‘Connect-MsolService’, function, script file, or operable program.

A quick Google for that turned up ‘You need to run an Import-Module MSOnline‘ command, but doing that simply gave me;

PS C:\Users> Import-Module MSOnline
Import-Module : The specified module 'MSOnline' was not loaded because no valid module file was found in any module
directory.
At line:1 char:1
+ Import-Module MSOnline
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (MSOnline:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Solution

Well before you can run Import-Module MSOnline, run Install-Module MSOnline, you may need to answer ‘Y’ to proceed.

MSOnline was not loaded

Then, run Import-Module MSOnline and you are good to go!

Related Articles, References, Credits, or External Links

NA

Author: PeteLong

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *