Skip to content

Instantly share code, notes, and snippets.

@da9l
Last active February 6, 2017 13:40
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save da9l/2852270 to your computer and use it in GitHub Desktop.
Save da9l/2852270 to your computer and use it in GitHub Desktop.
Install chocolatey behind proxy with system settings in Internet Explorer.
$wc=new-object net.webclient
$wp=[system.net.WebProxy]::GetDefaultProxy()
$wp.UseDefaultCredentials=$true
$wc.Proxy=$wp
iex ($wc.DownloadString('https://chocolatey.org/install.ps1'))
@da9l
Copy link
Author

da9l commented Jun 1, 2012

I had problems with the provided oneliner for installing chocolatey behind our corporate proxy on a Windows 7 machine.
This script still require the user to issue Set-ExecutionPolicy Unrestricted in an administrator enabled powershell prompt.

@ferventcoder
Copy link

Don't use the bitly link anymore.

Update it to https://chocolatey.org/install.ps1

@da9l
Copy link
Author

da9l commented Aug 9, 2013

Thanks, Do you know if there is a better oneliner that works behind proxy?

@dazzag24
Copy link

This worked for me:

@PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "$wc=new-object net.webclient; $wp=[system.net.WebProxy]::GetDefaultProxy(); $wp.UseDefaultCredentials=$true; $wc.Proxy=$wp; iex ($wc.DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

@derekslenk
Copy link

What @dazzag24 said worked perfectly for me

@lirigo
Copy link

lirigo commented Oct 16, 2014

for me too, thanks!

@wrey75
Copy link

wrey75 commented Nov 14, 2014

Someone should provide the trick to the CHOCOLATERY Website rather in this quite obscure page (thanks to Google). It works like a charm. I suppose this trick also work with no proxy at all. Tested on Windows7 32 bits.

@dokuboyejo
Copy link

Once you're happy with guide from @dazzag24, set http_proxy, https_proxy and chocolateyProxyLocationenvironment variable for your proxy location

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment