When installing Powershell modules from the gallery, you may run into the following error, particularly on older versions of Windows (even Windows 10):
PS C:\WINDOWS\system32> Install-Module -Scope AllUsers -Name module-name WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2/'. PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'module-name'. Try Get-PSRepository to see all available registered module repositories.
The most common reason for this (aside of having some other issue with internet access) is that Powershell may still be using TLS 1.0, which is no longer supported by Powershell Gallery.
To fix this, you can set the protocol to use to TLS 1.2 via Powershell:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
The switch is immediate, meaning you can now try installing the module again.
« ‹ | December 2024 | › » | ||||
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |