Fix Powershell SSL/TLS error for chocolatey download

This commit is contained in:
HomeSen 2020-02-06 17:51:04 +01:00
parent 6a17501824
commit a47a60f37d
2 changed files with 2 additions and 1 deletions

View File

@ -185,7 +185,7 @@
{
"type": "powershell",
"inline": [
"$env:chocolateyVersion = '0.10.8'; iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))"
"$env:chocolateyVersion = '0.10.8'; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))"
],
"pause_before": "60s"
},

View File

@ -1,5 +1,6 @@
$ChocoInstallPath = "$env:SystemDrive\ProgramData\Chocolatey\bin"
if (!(Test-Path $ChocoInstallPath)) {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
}