2

For a reporting tool I need to download an XML which is only accessible through a SOCKS proxy. My idea was to install the proxy in IE but disable it, then in powershell enable it a few seconds so I download it, but that doesn't seem to work. Anybody got any other work-arounds?

Here is my code

$proxyAddr = (get-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').ProxyServer
$proxy = new-object System.Net.WebProxy
$proxy.Address = $proxyAddr
$proxy.useDefaultCredentials = $true

$url = "https://appmon-apm.####.##/rest/management/dashboard/xmlgen"
$wc = new-object system.net.WebClient
$wc.proxy = $proxy
$webpage = $wc.DownloadData($url)
$str
Ynias Reynders
  • 309
  • 1
  • 14
  • `WebClient` doesn't support SOCKS, but see [here](https://stackoverflow.com/a/46965130/4137916). PowerShell can, of course, call any .NET code you like by importing it with `Add-Type`. – Jeroen Mostert Feb 12 '18 at 13:31

0 Answers0