In this Azure tutorial, we will discuss how to fix the error. No match was found for the specified search criteria and module name ‘Az’. which comes while trying to install the Azure PowerShell Az module using PowerShell in Azure.
No match was found for the specified search criteria and module name ‘Az’
Recently, for some of the Operations in Azure using the PowerShell ISE, I was trying to run the PowerShell script to install the Az module for PowerShell and then I got the Azure Az Powershell module error, i.e., no match was found for the specified search criteria and module name. Below is the PowerShell script I executed to install the Az PowerShell module.
if (Get-Module -Name AzureRM -ListAvailable) {
Write-Warning -Message 'Azure module not installed.'
} else {
Install-Module -Name Az -AllowClobber -Scope AllUsers
}
The exact error message was as below
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:1809 char:21
- … $null = PackageManagement\Install-Package @PSBoundParameters
~~~~~~~~~~~~- CategoryInfo : ObjectNotFound: (Microsoft.Power….InstallPackage:InstallPackage
) [Install-Package], Exception - FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cm
dlets.InstallPackage
- CategoryInfo : ObjectNotFound: (Microsoft.Power….InstallPackage:InstallPackage
No match was found for the specified search criteria and module name ‘Az’ [Solved]
To fix the error, No match was found for the specified search criteria and module name ‘Az’. You need to follow the below steps.
1. Now Open the PowerShell with Run as Administrator mode.

2. Now You need to enable the Security Protocol Tls12, You can use the below command.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
3. Once you execute the above command, ensure the Security Protocol Tls12 is enabled for you or not. You can check by running the below command.
[Net.ServicePointManager]::SecurityProtocol
4. Now try running the below PowerShell script again to install the Az module. You can see that the below PowerShell script ran successfully. and Now click on the Yes button for confirmation of the installation.
if (Get-Module -Name AzureRM -ListAvailable) {
Write-Warning -Message 'Azure module not installed.'
} else {
Install-Module -Name Az -AllowClobber -Scope AllUsers
}
Note: if you are still facing the same issue after executing the above script then, try running the below command now and run the