PowerShell Dealing with Proxy

# Direct Access – no proxy
netsh winhttp reset proxy
 
# Set proxy
$proxyString = “http://proxy01:port”
$proxyUri = new-object System.Uri($proxyString)
[System.Net.WebRequest]::DefaultWebProxy = new-object System.Net.WebProxy ($proxyUri, $true)
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials

Leave a Reply

Your email address will not be published. Required fields are marked *