how to set proxy on invoke-webrequest

Sara 441 Reputation points
2024-06-14T14:10:40.7033333+00:00

can someone help me with how I can pass proxy here in this script and if I am missing any syntax here? Full script in comment section! running into defender.ps1 is not recognized and a invalid err token error

Invoke-WebRequest @parameters

.\defender.ps1 -type dockerWindows -consoleCN us-east1.cloud.twistlock.com -install
Windows for business Windows Server User experience PowerShell
{count} votes

Accepted answer
  1. Rich Matheisen 47,901 Reputation points
    2024-06-14T15:26:01.6766667+00:00

    You can just add Proxy = <ProxyURLGoesHere> to the $parameters hash.

    The "not recognized" error usually just means the file "defender.ps1" wasn't found in the current directory.

    Not sure about the "invalid token" problem without knowing where in the script the error occurs.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.