问题
Error :
Import-Module : The specified module 'msonline' was not loaded because no valid module file was found in any module directory
The error pops up when I try to load the module by typing :
Import-Module MSOnline
tried to install the Azure AD powershell module on my computer so I'd be able to make PSSession using the MSONLINE cmdlets.
After I installed the Microsoft Online Services Sign-in Assistant (version7.250.4556.0) and then installed the latest Windows Azure AD Module for Windows Powershell, I get the above error in the title.
I can do following cmd and get output :
(get-item C:\Windows\System32\WindowsPowerShell\v1.0\Modules\MSOnline\Microsoft.Online.Administration.Automation.PSModule.dll).VersionInfo.FileVersion
Output : 1.0.8362.1
I was originally following this guide :
https://onlinehelp.coveo.com/en/ces/7.0/administrator/installing_the_windows_azure_ad_module_for_windows_powershell.htm
I can confirm on another computer where this Module is working fine that the files in the path (where the module files should reside) are the same as my computer that isn't working :
C:\Windows\System32\WindowsPowerShell\v1.0\Modules\MSOnline
I've already rebooted after installation. I've tried to install different version of the Azure AD Module from here to no avail.
Hardware/Software Version info :
Computer : Microsoft Surface Pro 3
OS Version : Windows 8.1 64-bit
PowerShell Version : Major 4 Minor 0 Build -1 Revision -1
Any help with this is greatly appreciated.
回答1:
I found out the issue.
There are 2 binaries that you need to install to get this working :
- Microsoft Online Services Sign-In Assistant for IT Professionals RTW
- Azure Active Directory Module for Windows PowerShell
Both of these need to be the 64bit version to work together (in my case since I have a x64bit OS).
When I was trying to install the Online Services Sign-In Assistant through IE it kept giving me the 32bit MSI, even though I was asking for the 64bit installer.
I realized this after I tried to save the file, instead of just hitting RUN on the download.
Once I switched to chrome I was able to download the 64bit version.
After I had the 64bit version of both binaries installed everything worked as expected.
来源:https://stackoverflow.com/questions/32829788/import-module-the-specified-module-msonline-was-not-loaded-because-no-valid