No match was found for the specified search criteria and module name ‘MSOnline’

In this azure tutorial, we will discuss how to fix the error, No match was found for the specified search criteria and module name ‘MSOnline’. which comes while trying to install the MSOnline module in PowerShell in Azure

No match was found for the specified search criteria and module name ‘MSOnline’

Recently, I was trying to install the MSOnline module in PowerShell ISE, I got the above error. I was executing the below cmdlet to install the MSOnline.

PS C:\windows\system32> Install-Module -Name MSOnline

You can see below what was the exact issue that is highlighted in red color.

No match was found for the specified search criteria and module name 'MSOnline'

The exact error that occurred was as mentioned like below .

PackageManagement\Install-Package: No match was found for the specified search criteria and module name ‘MSOnline’. 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.Cmdlets.InstallPackage

Solution

Now to fix the above issue, you can follow the article on Install-packageprovider no match was found for the specified search criteria for the provider ‘nuget’.

This article also fixes the error “Install-packageprovider no match was found for the specified search criteria for the provider ‘nuget’”

Now once you will follow the steps mentioned in the above article, you should be able to install the MSOnline module using the below cmdlet

PS C:\windows\system32> Install-Module -Name MSOnline
How to fix No match was found for the specified search criteria and module name 'MSOnline'

You can run the below cmdlet to see all available registered module repositories

PS C:\windows\system32> Get-PSRepository

You can see here

Solution for  No match was found for the specified search criteria and module name 'MSOnline'

You may like following Azure tutorials:

Conclusion

In this Azure tutorial, we discussed how exactly you can fix the error, No match was found for the specified search criteria and module name ‘MSOnline’ and Install-packageprovider no match was found for the specified search criteria for the provider ‘nuget’ I hope it helped you to fix your issues.

Leave a Comment