Invoke-WebRequest GetSystemWebProxy()

后端 未结 3 1398
深忆病人
深忆病人 2021-02-09 03:09

Under PowerShell 2.0 I know that you can set the proxy you would like to use without knowing the exact proxy settings by doing something like the following:

$pro         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-09 03:58

    Use can use this code :

    $dest = "http://www.google.fr"
    $proxyurl = ([System.Net.WebRequest]::GetSystemWebproxy()).GetProxy($dest)
    Invoke-WebRequest $dest -Proxy $proxyurl -ProxyUseDefaultCredentials
    

提交回复
热议问题