Azure Resource Manager modules

Tushar Vasant Dalvi 1 Reputation point
2022-08-12T17:37:05.087+00:00

While running the below script i am getting the error.

Install-Module -Name Az -MinimumVersion 5.1.0 -AllowClobber -Scope AllUsers

Error:-

PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'Az'. Try Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21

  • ... $null = PackageManagement\Install-Package @PSBoundParameters
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
  • FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,280 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. kobulloc-MSFT 24,246 Reputation points Microsoft Employee
    2022-08-13T20:33:20.257+00:00

    Hello, @Tushar Vasant Dalvi !

    What version of PowerShell are you using? This is the list of initial troubleshooting steps:

    • Repository registry: If your repository registry is in a bad state, you may need to unregister and then register the repository again (Register-PSRepository -Default, where -Default registers PSGallery).
    • TLS 1.2: Some people have reported success when using TLS 1.2 by running [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    • Scope: Although you've set your scope here, setting -scope to currentuser may be helpful

    Let me know if this worked for you! If not, we can do some more troubleshooting.

    Resources:

    0 comments No comments