From 7b5f74e43a7f91245f16eb9371839f9ddf1f0d64 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Tue, 3 Jan 2017 22:13:50 -0600 Subject: [PATCH] (GH-1117) Get-ChocolateyWebFile - Url Overrides Allow urls to be overridden based on environment variables. --- .../helpers/functions/Get-ChocolateyWebFile.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 b/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 index 067600fc01..2c4f99422b 100644 --- a/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 @@ -209,6 +209,12 @@ param( Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters + # url overrides + $urlOverride = $env:ChocolateyUrlOverride + $url64bitOverride = $env:ChocolateyUrl64bitOverride + if ($urlOverride -ne $null -and $urlOverride -ne '') { $url = $urlOverride } + if ($url64bitOverride -ne $null -and $url64bitOverride -ne '') { $url64bit = $url64bitOverride } + if ($url -ne $null) { $url = $url.Replace("//","/").Replace(":/","://") } if ($url64bit -ne $null) { $url64bit = $url64bit.Replace("//","/").Replace(":/","://") }