PackageManagement\Install-Package : No match was found for the specified search criteria and module name
This post describes how to fix the error PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'AzureRM', 'nuget', 'azuread', 'msonline', 'vmware.powercli', sqlserver' and more.
Cause
This error can occur when trying to install packages/modules if the account being used does not have any repositories configured. You can check this by running:
Get-PSRepository
Note: I had to install PowerShell v5 from Windows Management Framework 5 (WMF 5) for Get-PSRepository to work. Please read this post if PowerShell does not open on Windows Server 2008 R2 after installing WMF 5.
Resolution
If the PowerShell Gallery (PSGallery) repository is not installed, either logon as another user who has this repository installed, or restore it by running (ensure you have an internet connection):
Register-PSRepository -Default
If this fails, please see my other post No match was found for the specified search criteria for the provider 'NuGet'
If this succeeds, you should now be able to install packages/modules.
Note: You can trust PSGallery so that you don't get the "Are you sure you want to install" prompt by running:
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
I have PSGallery installed but still getting the "No match..." error.
ReplyDeleteThere must be more to it. Thanks for trying, anyway.
Thanks for letting me know. Please do post back if you find a solution that works for you.
Delete