Cloud Proxy Authentication using PAC FIle?

Iron Contributor

Hi Support,

 

Any idea or workaround how to do this on PowerShell?
I want to invoke a web request but it needs a authentication via cloud.

I already tried Invoke-WebRequest -Uri "https://www.google.com" -Credential $credential
So far its not working. Thanks.

 

1 Reply

Hello @Alan2022,

There are two parameters of Invoke-WebRequest to cover your use case: Proxy and ProxyCredential

Proxy accepts URI of the proxy server and ProxyCredential is a type of PSCredential.

So in your case it would be:

Invoke-WebRequest -Uri "https://www.google.com" -Proxy "<Proxy Server URL>" -ProxyCredential $credential

 

Reference: Invoke-WebRequest

 

Hope that helps.