[英]powershell http get not use proxy
I have script to GET HTTP content and I need baypass Proxy (connect directly to webserver IP). 我有脚本来获取HTTP内容,我需要baypass代理(直接连接到webserver IP)。 Is it possible without changing registers in Windows?.
是否可以不更改Windows中的寄存器? This code is going through proxy defined in system.
此代码通过系统中定义的代理进行。 Thanks for advice
谢谢你的建议
Best regards. 最好的祝福。
$url='https://10.10.10.10/check';
$webClient = new-object System.Net.WebClient;
$output = $webClient.DownloadString($url)
According to the documentation you have to set the proxy to a blank proxy instance. 根据文档,您必须将代理设置为空白代理实例。 Try this:
尝试这个:
$url = "https://10.10.10.10/check"
$webClient = New-Object System.Net.WebClient
$webClient.Proxy = [System.Net.GlobalProxySelection]::GetEmptyWebProxy()
$output = $webClient.DownloadString($url)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.