Last active
August 29, 2015 14:05
-
-
Save wgross/f726ec5645ec59e476e8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Make a download with webclient using the DefaultNetworkCredentials to authenticate at proxy. | |
Afterwards all new webclient based cmdlets can pass the proxy. | |
.DESCRIPTION | |
Make a download with webclient using the DefaultNetworkCredentials to authenticate at proxy. | |
Afterwards all new webclient based cmdlets can pass the proxy. | |
.EXAMPLE | |
Just call to install credentials | |
Initialize-WebClientProxyCredentials.ps1 | |
.LINK | |
http://blog.stangroome.com/2013/08/02/powershell-update-help-and-an-authenticating-proxy/ | |
#> | |
# make one download through proxy with authentication | |
$wc = New-Object System.Net.WebClient | |
$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials | |
$tmp = $wc.DownloadString('http://microsoft.com') | |
Write-Host "Default network credentials are installed. You can use other WebClient based clients" -ForegroundColor Green |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment