Skip to content

Fix PackageManagement\Install-Package : No match was found for the specified search criteria and module name

When we try to install a PowerShell module on the system, an error appears that no match was found for the specified search criteria and module name. It doesn’t matter which module we want to install; the same error appears. In this article, you will learn how to fix the error PackageManagement\Install-Package : No match was found for the specified search criteria and module name.

Solution for Install-Package : No match was found for the specified search criteria

Go through the steps below to fix the error that appears in PowerShell when you run the Install-Module cmdlet.

PackageManagement\Install-Package error

1. Enable TLS 1.2

To enable TLS 1.2 on the system, run both cmdlets to set .NET Framework strong cryptography registry keys.

Set strong cryptography on 64-bit .Net Framework (version 4 and above).

Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord

Set strong cryptography on 32-bit .Net Framework (version 4 and above).

Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord

Important: Restart PowerShell after you apply the above changes.

Read more in the article Unable to install NuGet provider for PowerShell.

2. Unregister PSGallery

Unregister PowerShell Gallery by running the Unregister-PSRepository cmdlet.

Unregister-PSRepository -Name PSGallery

3. Register PSGallery

Register PowerShell Gallery as the default repository by running the Register-PSRepository cmdlet.

Register-PSRepository -Default

4. Verify PSGallery

Run the Get-PSRepository and verify that the PSGallery repository appears in the list

Get-PSRepository

The output appears.

Name      InstallationPolicy SourceLocation
----      ------------------ --------------
PSGallery Untrusted          https://www.powershellgallery.com/api/v2

That’s it! Now you can install the module in PowerShell successfully without the error.

Read more: How to Enable TLS 1.2/TLS 1.3 on Windows Server »

Conclusion

You learned how to fix PackageManagement\Install-Package : No match was found for the specified search criteria and module name. The solution to this error is to enable TLS 1.2 and re-register the default PSGallery on the system. After that, you can install the module in PowerShell.

Did you enjoy this article? You may also like Enable Receive Side Scaling (RSS) on network adapter. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *