Skip to content

Instantly share code, notes, and snippets.

@erichexter
Created September 13, 2012 19:35
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save erichexter/3717010 to your computer and use it in GitHub Desktop.
Save erichexter/3717010 to your computer and use it in GitHub Desktop.
install chocolatey with windows auth proxy
Set-ExecutionPolicy -ExecutionPolicy Unrestricted;$a=new-object net.webclient;$a.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials;$a.downloadstring('http://bit.ly/OKgXHP')|iex
@erichexter
Copy link
Author

Here is how to call this from an Administrator Powershell window:

$a=new-object net.webclient;$a.proxy.credentials=[system.net.credentialcache]::Defaultnetworkcredentials;$a.down
loadstring('http://bit.ly/OKgXHP')|iex

@ferventcoder
Copy link

And this works on a non-proxied network as well correct?

@DanAtkinson
Copy link

Excellent! Works fine for me inside a 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

@kitt-vl
Copy link

kitt-vl commented Aug 25, 2014

what if i need not default system proxy?

@MMrR0b0TT
Copy link

Perfectly!

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