Skip to content

Commit

Permalink
Allow Bypass list to be passed into the proxy
Browse files Browse the repository at this point in the history
actions/setup-dotnet#
  • Loading branch information
Zachary Eisinger authored Jul 16, 2020
1 parent 14bc876 commit c8eda6f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/dotnet-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
.PARAMETER ProxyUseDefaultCredentials
Default: false
Use default credentials, when using proxy address.
.PARAMETER ProxyBypassList
If set with ProxyAddress, will provide the list of comma separated urls that will bypass the proxy
.PARAMETER SkipNonVersionedFiles
Default: false
Skips installing non-versioned files if they already exist, such as dotnet.exe.
Expand Down Expand Up @@ -96,6 +98,7 @@ param(
[string]$FeedCredential,
[string]$ProxyAddress,
[switch]$ProxyUseDefaultCredentials,
[string]$ProxyBypassList="",
[switch]$SkipNonVersionedFiles,
[switch]$NoCdn
)
Expand Down Expand Up @@ -253,7 +256,11 @@ function GetHTTPResponse([Uri] $Uri)

if($ProxyAddress) {
$HttpClientHandler = New-Object System.Net.Http.HttpClientHandler
$HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{Address=$ProxyAddress;UseDefaultCredentials=$ProxyUseDefaultCredentials}
$HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{
Address=$ProxyAddress;
UseDefaultCredentials=$ProxyUseDefaultCredentials;
BypassList = $ProxyBypassList.Split(",")
}
$HttpClient = New-Object System.Net.Http.HttpClient -ArgumentList $HttpClientHandler
}
else {
Expand Down

0 comments on commit c8eda6f

Please sign in to comment.