Powershell Can';t安装AzureADPreview

Powershell Can';t安装AzureADPreview,powershell,azure-powershell,Powershell,Azure Powershell,我无法在我的机器上安装。当我运行“安装模块-名称AzureADPreview”时,会收到错误消息: 找不到与指定搜索条件和模块名称“AzureADPreview”匹配的项 如果我运行“Get-PSRepository”,我将获得 警告:找不到模块存储库 我花了几个小时试图解决这个问题,但没有结果。我的第一个想法是可能没有提供程序设置,但运行“Get-PackageProvider-ListAvailable”显示 我想可能是Nuget安装不正确,所以我使用“Install PackageProv

我无法在我的机器上安装。当我运行“安装模块-名称AzureADPreview”时,会收到错误消息:

找不到与指定搜索条件和模块名称“AzureADPreview”匹配的项

如果我运行“Get-PSRepository”,我将获得

警告:找不到模块存储库

我花了几个小时试图解决这个问题,但没有结果。我的第一个想法是可能没有提供程序设置,但运行“Get-PackageProvider-ListAvailable”显示

我想可能是Nuget安装不正确,所以我使用“Install PackageProvider-Name Nuget-MinimumVersion 2.8.5.201-Verbose-Force”重新安装了它,这与同样的问题相同。有趣的是,我可以找到使用巧克力的软件包,但AzureADPreview并没有在那个里托管

我的计算机运行的是安装了.Net Framework 4.6.2的Windows 10


我遗漏了一些非常明显的东西吗?

根据您的描述,要从库中安装项目,需要最新版本的PowerShellGet模块,该模块可在Windows 10、Windows Management Framework(WMF)5.0或基于MSI的安装程序(适用于PowerShell 3和4)中获得

我们可以使用PowerShell查看WMF的版本:

PS C:\windows> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.693
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.693
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
获取WMF 5.0或更高版本,PSVersion是WMF版本,my WMF版本是5.1


以下是AzureadPreview的要求,请参阅。

在windows 10上出现了完全相同的问题。我支持一家公司的代理人

步骤1:[System.Net.WebRequest]::DefaultWebProxy.Credentials=[System.Net.CredentialCache]::DefaultCredentials

步骤2:注册PSRepository-默认

步骤3:获取PSRepository

希望这对你也有用。这一切都是从我试图执行死刑时开始的


安装模块AzureADPreview

正如我在说明中所说,我有Windows 10,因此我已经有了最新版本的PowerShellGet。我的PSVersion是5.1.14393.953。@mob1lejunkie请尝试使用此命令注册PSGallery
register PSRepository-Default
然后尝试
Get PSRepository
@mob1lejunkie
Get PSRepository
仍然警告:找不到模块存储库?是的,仍然是相同的警告。@mob1lejunkie请尝试
Get module-NamePackageManager
获取packagesource
。powershell中有列表吗?