当我尝试在powershell命令提示符下运行时:
安装模块Az -Force -confirm:$false -AllowClobber -Scope CurrentUser
获取以下错误:
警告:“Az”匹配模块'Az/4.6.0‘来自提供者:'PowerShellGet',存储库'PSGallery’。警告:“Az”匹配模块'Az/4.6.0‘来自提供者:'PowerShellGet',存储库'PSGallery1’。PackageManagement\ install -Package :无法安装,多个模块匹配“Az”。请指定一个-Repository。C:\ Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
.= PackageManagement\Install-Package @PSBoundParameters CategoryInfo : InvalidArgument: InvalidArgument Install,Exception FullyQualifiedErrorId : DisambiguateForInstall,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPa批处理
发布于 2020-08-27 09:54:57
由于您有两个与Az模块匹配的存储库,因此需要提供要使用哪个存储库来获取该模块:
Install-Module Az -Force -confirm:$false -AllowClobber -Scope CurrentUser -Repository "PSGallery"或者,如果一个存储库是重复的,则可以取消注册:
Get-PsRepository
Unregister-PSRepository -Name "PSGallery1"发布于 2020-08-27 09:50:52
切换到TLS1.2可能会有所帮助:为此运行以下命令,然后重试安装Az
PS C:\> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12https://stackoverflow.com/questions/63612214
复制相似问题