win_chocolatey: Fix hang on missing/required base env vars (#51154)
* win_chocolatey: Fix crash on missing/required base env vars * Add changelog fragmentpull/4420/head
parent
9ec9f18b13
commit
5540d66747
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- win_chocolatey - Fix hang when used with proxy for the first time - https://github.com/ansible/ansible/issues/47669
|
|
@ -213,6 +213,7 @@ Function Install-Chocolatey {
|
||||||
if ($proxy_url) {
|
if ($proxy_url) {
|
||||||
# the env values are used in the install.ps1 script when getting
|
# the env values are used in the install.ps1 script when getting
|
||||||
# external dependencies
|
# external dependencies
|
||||||
|
$environment = [Environment]::GetEnvironmentVariables()
|
||||||
$environment.chocolateyProxyLocation = $proxy_url
|
$environment.chocolateyProxyLocation = $proxy_url
|
||||||
$web_proxy = New-Object -TypeName System.Net.WebProxy -ArgumentList $proxy_url, $true
|
$web_proxy = New-Object -TypeName System.Net.WebProxy -ArgumentList $proxy_url, $true
|
||||||
$client.Proxy = $web_proxy
|
$client.Proxy = $web_proxy
|
||||||
|
|
Loading…
Reference in New Issue