diff --git a/lib/core.ps1 b/lib/core.ps1 index 11daac73f5..9783167cea 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -229,6 +229,7 @@ function Invoke-Git { ) $proxy = get_config PROXY + $no_proxy = get_config NO_PROXY $git = Get-HelperPath -Helper Git if ($WorkingDirectory) { @@ -243,11 +244,15 @@ function Invoke-Git { $j = Start-Job -ScriptBlock { # convert proxy setting for git $proxy = $using:proxy + $no_proxy = $using:no_proxy if ($proxy -and $proxy.StartsWith('currentuser@')) { $proxy = $proxy.Replace('currentuser@', ':@') } $env:HTTPS_PROXY = $proxy $env:HTTP_PROXY = $proxy + if ($no_proxy) { + $env:NO_PROXY = $no_proxy + } & $using:git @using:ArgumentList } $o = $j | Receive-Job -Wait -AutoRemoveJob diff --git a/lib/download.ps1 b/lib/download.ps1 index ab74d92652..06eb0c3e20 100644 --- a/lib/download.ps1 +++ b/lib/download.ps1 @@ -557,6 +557,7 @@ function Get-UserAgent() { function setup_proxy() { # note: '@' and ':' in password must be escaped, e.g. 'p@ssword' -> p\@ssword' $proxy = get_config PROXY + $no_proxy = get_config NO_PROXY if (!$proxy) { return } @@ -578,6 +579,10 @@ function setup_proxy() { $username, $password = $credentials -split '(?