Invoke-WebRequest and proxy RRS feed

  • Question

  • I am newbie to Powershell and I am just using a test script to see if I can get to the internet through our proxy server. I am using the following script:








    .Links |Foreach{$_.href }

    WebRequest : Proxy authorization required. Any help would be appreciated. The username and password are correct.

    Tuesday, August 12, 2014 6:40 PM


  • Hi Chantilly,

    Please try to provide the port of the proxy server in the parameter "Proxy":

    $secPasswd=ConvertTo-SecureString "password" -AsPlainText -Force
    $myCreds=New-Object System.Management.Automation.PSCredential -ArgumentList "Domain\name",$secPasswd
    $Test=Invoke-WebRequest -URI $Site -Proxy '' -ProxyCredential $mycreds

    In addition, this similar script is for your reference:

    Invoke-WebRequest GetSystemWebProxy()

    If there is anything else regarding this script, please feel free to let me know.

    Best Regards,

    Anna Wang

    • Marked as answer by AnnaWY Monday, August 25, 2014 10:32 AM
    Thursday, August 14, 2014 2:56 AM