PowerShell, Web Requests, and Proxies

前端 未结 6 1133
遇见更好的自我
遇见更好的自我 2020-12-12 17:36

When making a simple web request is there a way to tell the PowerShell environment to just use your Internet Explorer\'s proxy settings?

My proxy settings are contro

6条回答
  •  醉梦人生
    2020-12-12 18:09

    $proxy = New-Object System.Net.WebProxy("http://yourProxy:8080")
    $proxy.useDefaultCredentials = $true
    $wc = new-object system.net.webclient
    $wc.proxy = $proxy
    $wc.downloadString($url)
    

提交回复
热议问题