How to bypass the default proxy in Windows while accessing a locally accessible URL?
By default the Invoke-WebRequest powershell cmdlet is using the
You can programmatically bypass proxy for local addresses and even return the old bypass list after you are done.
My function proxy will let you do that. Add your domain or server name or its IP address to override list:
$p = proxy
$p.Override += "*.domain.com"
$p | proxy
Invoke-WebRequest ...
#you could return old override here.
Otherwise, I think this should work:
$proxy = new-object System.Net.WebProxy
Invoke-WebRequest -Proxy $proxy ...