Force powershell to use TLS 1.2 as chocolatey.org throws a TLS error

This commit is contained in:
Ahmed Shawky
2020-02-05 02:47:03 +04:00
parent 24d2d5e9b0
commit fea8f35f0e

View File

@@ -1,6 +1,7 @@
# Purpose: Installs chocolatey package manager, then installs custom utilities from Choco.
If (-not (Test-Path "C:\ProgramData\chocolatey")) {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Write-Host "Installing Chocolatey"
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
} else {