导入模块:未加载指定的模块“msonline",因为在任何模块目录中都找不到有效的模块文件 [英] Import-Module : The specified module 'msonline' was not loaded because no valid module file was found in any module directory

查看:305
本文介绍了导入模块:未加载指定的模块“msonline",因为在任何模块目录中都找不到有效的模块文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误:

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

尝试在我的计算机上安装 Azure AD powershell 模块,以便我能够使用 MSONLINE cmdlet 进行 PSSession.

tried to install the Azure AD powershell module on my computer so I'd be able to make PSSession using the MSONLINE cmdlets.

在我安装 Microsoft Online Services 登录助手(版本 7.250.4556.0)并安装最新的 Windows Azure AD 模块 for Windows Powershell 后,我在标题中收到上述错误.

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.

我可以执行以下 cmd 并获得输出:

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

输出: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.

硬件/软件版本信息:
电脑:微软 Surface Pro 3
操作系统版本:Windows 8.1 64 位
PowerShell 版本:主要 4 次要 0 构建 -1 修订版 -1

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.

推荐答案

我发现了这个问题.

您需要安装 2 个二进制文件才能使其正常工作:

There are 2 binaries that you need to install to get this working :

  • 面向 IT 专业人员 RTW 的 Microsoft 在线服务登录助手
  • 适用于 Windows PowerShell 的 Azure Active Directory 模块

这两者都需要是 64 位版本才能协同工作(就我而言,因为我有一个 x64 位操作系统).

Both of these need to be the 64bit version to work together (in my case since I have a x64bit OS).

当我尝试通过 IE 安装在线服务登录助手时,它一直为我提供 32 位 MSI,即使我要求的是 64 位安装程序.

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.

一旦我切换到 chrome,我就可以下载 64 位版本.

Once I switched to chrome I was able to download the 64bit version.

在我安装了两个二进制文件的 64 位版本后,一切都按预期工作.

After I had the 64bit version of both binaries installed everything worked as expected.

这篇关于导入模块:未加载指定的模块“msonline",因为在任何模块目录中都找不到有效的模块文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆