File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,11 @@ $architecture = if (-not $IsWinEnv) {
9191$tempDir = Join-Path ([System.IO.Path ]::GetTempPath()) ([System.IO.Path ]::GetRandomFileName())
9292New-Item - ItemType Directory - Path $tempDir - Force > $null
9393try {
94+ # Setting Tls to 12 to prevent the Invoke-WebRequest : The request was
95+ # aborted: Could not create SSL/TLS secure channel. error.
96+ $originalValue = [Net.ServicePointManager ]::SecurityProtocol
97+ [Net.ServicePointManager ]::SecurityProtocol = [Net.ServicePointManager ]::SecurityProtocol -bor [Net.SecurityProtocolType ]::Tls12
98+
9499 if ($Daily ) {
95100 if (-not (Get-Module - Name PackageManagement - ListAvailable)) {
96101 throw " PackageManagement module is required to install daily PowerShell Core."
@@ -227,5 +232,8 @@ try {
227232 Write-Host " Please restart pwsh" - ForegroundColor Magenta
228233 }
229234} finally {
235+ # Restore original value
236+ [Net.ServicePointManager ]::SecurityProtocol = $originalValue
237+
230238 Remove-Item - Path $tempDir - Recurse - Force - ErrorAction SilentlyContinue
231239}
You can’t perform that action at this time.
0 commit comments