File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,22 @@ Remove-Item C:\amazon-cloudwatch-agent.msi
3030
3131# Install dependent tools
3232Write-Host " Installing additional development tools"
33- choco install git awscli - y
33+ choco install git awscli powershell - core - y
3434refreshenv
3535
3636Write-Host " Creating actions-runner directory for the GH Action installation"
3737New-Item - ItemType Directory - Path C:\actions- runner ; Set-Location C:\actions- runner
3838
3939Write-Host " Downloading the GH Action runner from ${action_runner_url} "
40- Invoke-WebRequest - Uri ${action_runner_url} - OutFile actions- runner.zip
40+ # Direct download with WebClient to prevent forced disconnects
41+ $downloadCommand = @"
42+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
43+ `$ webClient = New-Object System.Net.WebClient
44+ `$ webClient.Headers.Add('User-Agent', 'PowerShell/7.0')
45+ `$ webClient.DownloadFile('${action_runner_url} ', 'actions-runner.zip')
46+ `$ webClient.Dispose()
47+ "@
48+ pwsh - Command $downloadCommand
4149
4250Write-Host " Un-zip action runner"
4351Expand-Archive - Path actions- runner.zip - DestinationPath .
You can’t perform that action at this time.
0 commit comments