Proxy Authentication
1 TopicProxy Authentication
Hi, I am trying to create a PowerShell script to get my proxy ip from ipify.org and save it to a file I have used their sample code but get the error, 407 Proxy Authentication Required $ip = Invoke-RestMethod -Uri 'https://api.ipify.org?format=json' "My public IP address is: $($ip.ip)" I have looked for ways to do this and found this; $Wcl=New-Object System.Net.WebClient $Creds=Get-Credential $Wcl.Proxy.Credentials=$Creds However this pops up a credential window and lets me manually enter the username and password. I don't really want this, I would like the username and password typed into the script. For example; $ip = Invoke-RestMethod -Uri 'https://USERNAME:PASSWORD@api.ipify.org?format=json' I know this is not the correct syntax as it gives me an error. I have my proxy server setup in the Windows 10 settings and it all works Can someone tell me if this is possible and what the correct syntax is? Thanks, jonny11KViews0likes1Comment