3

I can get and set proxy settings for a WebClient object and make outbound calls.

I can also supply -Proxy and -ProxyCredential to individual CmdLets, but how can I just set a global default so CmdLets don't need the extra arguments?

Thanks

Luke

2

From https://joshcodev.wordpress.com/2014/02/07/powershell-set-a-proxy/,

$global:PSDefaultParameterValues = @{ 'Invoke-RestMethod:Proxy'='http://proxyServer:proxyPort' 'Invoke-WebRequest:Proxy'='http://proxyServer:proxyPort' '*:ProxyUseDefaultCredentials'=$true }

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.