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'
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

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

Solution-1

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
no match was found for the specified search criteria and module name 'msonline'.
packagemanagement\install-package : 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'
packagemanagement\install-package : no match was found for the specified search criteria and module name ‘msonline’

The above steps will fix your issue. If you are still getting the error “No match was found for the specified search criteria and module name ‘MSOnline'” then try out the below steps

Solution-2

  1. Run the below PowerShell cmdlet to check the repository.
PS C:\WINDOWS\system32> Get-PSRepository

After running the above PowerShell cmdlet, there might be a chance you will get the WARNING: Unable to find module repositories. Run the below PowerShell cmdlet to fix this.

2. Run the below PowerShell cmdlet to reset the repository.

PS C:\WINDOWS\system32> Register-PSRepository -Default

3. Now again Run the below PowerShell cmdlet to check the repository.

PS C:\WINDOWS\system32> Get-PSRepository

You can able to see the Output 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.
install-module msonline no match was found

4. Now Run the Below PowerShell cmdlet to install the “MSOnline” module

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

Click on the Yes to All button to confirm the installation as shown below.

no match was found for the specified search criteria and module name 'msonline'.
no match was found for the specified search criteria and module name ‘msonline’.

Now You can able to see below, It started installing the MSOnline module without any issue.

packagemanagement\install-package : no match was found for the specified search criteria and module name 'msonline'
packagemanagement\install-package : 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’. The same solution will also fix the below errors

  • 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.
  • no match was found for the specified search criteria and module name ‘powershellget’
  • no match was found for the specified search criteria and module name msonline
  • no match was found for the specified search criteria
  • msonline module not found
  • no match was found for the specified search criteria and module name

I hope it helped you to fix your issues.