Last active
June 1, 2022 15:06
-
-
Save aev-mambro2/e0b5569e67ef43d850a1ae796155f228 to your computer and use it in GitHub Desktop.
Get Powershell NuGet to install modules if it complains it’s offline: set a better TLS cipher version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# Assuming your computing device is online and can get through the firewall, | |
it is possible (because that was the problem in my case), that Powershell | |
chose an internet security cipher that is outdated or not available. | |
Errors typically include: | |
WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''. | |
WARNING: Unable to download the list of available providers. Check your internet connection. | |
Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. | |
The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified | |
package has the tags. | |
This nugget of wisdom found here https://stackoverflow.com/a/61078227 | |
and here: | |
https://answers.microsoft.com/en-us/windows/forum/windows_7-performance/trying-to-install-program-using-powershell-and/4c3ac2b2-ebd4-4b2a-a673-e283827da143 | |
provides a solution that worked in my case. #> | |
<# 1: Tell .Net to use an available TLS protocol #> | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
<# 2: Retry the failed command, like: #> | |
Find-PackageProvider | |
<# or #> | |
Install-PackageProvider -Name NuGet | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I also published this on Medium: https://medium.com/@aev_software/get-powershell-nuget-to-install-modules-if-it-complains-its-offline-set-better-tls-cipher-version-10eaa7300823