Created
September 13, 2012 19:35
-
-
Save erichexter/3717010 to your computer and use it in GitHub Desktop.
install chocolatey with windows auth proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-ExecutionPolicy -ExecutionPolicy Unrestricted;$a=new-object net.webclient;$a.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials;$a.downloadstring('http://bit.ly/OKgXHP')|iex |
And this works on a non-proxied network as well correct?
Excellent! Works fine for me inside a proxy.
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
what if i need not default system proxy?
Perfectly!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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