Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

erichexter commented Sep 14, 2012

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

This comment has been minimized.

Copy link

ferventcoder commented Sep 16, 2012

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

@DanAtkinson

This comment has been minimized.

Copy link

DanAtkinson commented Aug 8, 2013

Excellent! Works fine for me inside a proxy.

@dazzag24

This comment has been minimized.

Copy link

dazzag24 commented Apr 24, 2014

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

This comment has been minimized.

Copy link

kitt-vl commented Aug 25, 2014

what if i need not default system proxy?

@MMrR0b0TT

This comment has been minimized.

Copy link

MMrR0b0TT commented Aug 18, 2015

Perfectly!

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