Reputation: 11
When i try running below powershell command on Powershell command prompt:
Install-Module Az -Force -confirm:$false -AllowClobber -Scope CurrentUser
Getting Below error:
WARNING: 'Az' matched module 'Az/4.6.0' from provider: 'PowerShellGet', repository 'PSGallery'. WARNING: 'Az' matched module 'Az/4.6.0' from provider: 'PowerShellGet', repository 'PSGallery1'. PackageManagement\Install-Package : Unable to install, multiple modules matched 'Az'. Please specify a single -Repository. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
... $null = PackageManagement\Install-Package @PSBoundParameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : InvalidArgument: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Pa ckage], Exception FullyQualifiedErrorId : DisambiguateForInstall,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPa ckage
Upvotes: 0
Views: 2129
Reputation: 2507
Since you have two repositories that is Matching the Az module you will need to provide which one to use to get the module:
Install-Module Az -Force -confirm:$false -AllowClobber -Scope CurrentUser -Repository "PSGallery"
Or you can unregister one repository if its a duplicate:
Get-PsRepository
Unregister-PSRepository -Name "PSGallery1"
Upvotes: 2
Reputation: 191
switching to TLS 1.2 might help: Run the following command for that and try again installing Az
PS C:\> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Upvotes: 0