简体   繁体   English

powershell http获取不使用代理

[英]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.

相关问题 从代理地址Powershell的CSV中获取sAMAccountName - Get sAMAccountNames from CSV of Proxy Address powershell 如何在powershell中使用默认会话凭证bitstransfer proxy - How to use use default session credentials bitstransfer proxy in powershell Powershell http从jenkins获取请求 - Powershell http get request from jenkins 如何在Powershell中发出HTTP Post / GET请求? - How to make a HTTP Post/GET request in Powershell? 从 Powershell 上的 HTTP 请求获取响应链接 - Get response link from HTTP request on Powershell 如何在带有配置文件的Powershell脚本中使用自定义WCF代理? - How to use a custom WCF proxy in a Powershell script with a config file? 使用远程主机作为代理来连接Powershell中的另一个客户端 - Use remote host as proxy to connect another client in powershell Powershell:从他们的代理地址获取特定域 email 地址 - Powershell: Get specific domain email address from their proxy addresses 在PowerShell中为PowerShell WebClient设置代理? - Setting a proxy in PowerShell on for the PowerShell WebClient? PowerShell 脚本在 IIS 中使用反向代理创建站点,例如。 http://localhost:9001 - PowerShell script to create a site in IIS with Reverse Proxy to eg. http://localhost:9001
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM