Packagemanagement\install-package : 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 up while trying to install the MSOnline module in PowerShell in Azure

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

I recently tried installing the MSOnline module in PowerShell ISE and 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.

packagemanagement\install-package : no match was found for the specified search criteria and module name 'msonline'.

The exact error that occurred was as mentioned 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

Packagemanagement\install-package : 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 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
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

install-module msonline no match was found

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. Run the below PowerShell cmdlet again to check the repository.

PS C:\WINDOWS\system32> Get-PSRepository

You can see the Output like the below

packagemanagement\install-package : no match was found for the specified search criteria and module name 'msonline'

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

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

As shown below, click the Yes to All button to confirm the installation.

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.

You can see below that it started installing the MSOnline module without any issues.

packagemanagement\install-package : no match was found for the specified search criteria and module name

You may like the following Azure tutorials:

Conclusion

This Azure tutorial 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.