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
Table of Contents
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.
- New-AzureRmResourceGroup: ‘this.Client.SubscriptionId’ cannot be null
- Azure.psm1 cannot be loaded because running scripts is disabled on this system
PS C:\windows\system32> Install-Module -Name MSOnline
You can see below what was the exact issue that is highlighted in red color.

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

You can run the below cmdlet to see all available registered module repositories
PS C:\windows\system32> Get-PSRepository
You can see here

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

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.

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

You may like following Azure tutorials:
- The term ‘Remove-AzureVM’ is not recognized as the name of a cmdlet
- Because of protocol error (code 0x112d) the remote session will be disconnected
- CS1061 C# ‘HttpRequest’ does not contain a definition for ‘Content’ and no accessible extension method ‘Content’ accepting a first argument of type ‘HttpRequest’ could be found
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.