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