Forum Discussion

Alan2022's avatar
Alan2022
Iron Contributor
Jun 15, 2022

Cloud Proxy Authentication using PAC FIle?

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

  • AndySvints's avatar
    AndySvints
    Steel Contributor

    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.

     

Resources