Skip to content

Commit

Permalink
update powershell proxy selection
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Wright <patrick@chef.io>
  • Loading branch information
Patrick Wright committed May 17, 2017
1 parent 3b33a1b commit f82bcbc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/mixlib/install/generator/powershell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def render_command
cmd << " -version #{options.product_version}"
cmd << " -channel #{options.channel}"
cmd << " -architecture #{options.architecture}" if options.architecture
cmd << " -http_proxy #{options.http_proxy}" if options.http_proxy
# Use options.proxy to determine which proxy option to use since
# WebProxy doesn't differentiate between http/https
cmd << " -http_proxy #{options.http_proxy}" if options.proxy
cmd << install_command_params if options.install_command_options
cmd << "\n"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function Get-WebContentOnFullNet {
$proxy = New-Object -TypeName System.Net.WebProxy
$wc = new-object System.Net.WebClient
$wc.Headers.Add("user-agent", "<%= user_agent_string %>")
$proxy.Address = $env:http_proxy
$proxy.Address = $http_proxy
$wc.Proxy = $proxy

if ([string]::IsNullOrEmpty($filepath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ function Install-Project {
$http_proxy
)

# Set http_proxy as env var
$env:http_proxy = $http_proxy

$package_metadata = Get-ProjectMetadata -project $project -channel $channel -version $version -prerelease:$prerelease -nightlies:$nightlies -architecture $architecture

if (-not [string]::IsNullOrEmpty($filename)) {
Expand Down

0 comments on commit f82bcbc

Please sign in to comment.