Sunday 21 February 2016

Powershell Through A Proxy

If you've ever been stuck in that situation where you need to scrape web pages or need other internet functions from behind a proxy...

Utilise the same proxy as IE:
netsh winhttp import proxy source=ie
If your proxy requires credentials:
$webclient=New-Object System.Net.WebClient
$creds=Get-Credential
$webclient.Proxy.Credentials=$creds