The specified module ‘MSOnline’ was not loaded.

KB ID 0001637


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
At line:1 char:1
+ Import-Module MSOnline
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (MSOnline:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand


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


Author: PeteLong

Share This Post On


  1. PS D:\TU765\FYP_Project\VS> Install-Module MSOnline
    Install-Module : The term ‘Install-Module’ is not recognized as the name of a cmdlet, function, script
    file, or operable program. Check the spelling of the name, or if a path was included, verify that the
    path is correct and try again.
    At line:1 char:1
    + Install-Module MSOnline
    + ~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (Install-Module:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    Post a Reply
    • Install ‘Management framework 5.1’ and try again?

      Post a Reply

Submit a Comment

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