get the default proxy by Powershell
The get by Proxy Default PowerShell
2023-09-11 14:14:21 时间
https://stackoverflow.com/questions/571429/powershell-web-requests-and-proxies
$proxyAddr = (get-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').ProxyServer
$proxy = new-object System.Net.WebProxy
$proxy.Address = $proxyAddr
$proxy.useDefaultCredentials = $true
$url = "http://stackoverflow.com"
$wc = new-object system.net.WebClient
$wc.proxy = $proxy
$webpage = $wc.DownloadData($url)
$str = [System.Text.Encoding]::ASCII.GetString($webpage)
Write-Host $str
相关文章
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
- The encoding that Notepad++ just calls “ANSI”, does anyone know what to call it for Ruby?
- What is the difference between POST and GET?
- get the request body of all quests before handle it
- 【CF1132F】Clear the String(动态规划)
- Xcode真机调试失败:The identity used to sign the executable is no longer valid
- golang错误:The process cannot access the file because it is being used by another process
- HDU 4968(杭电多校#9 1009题)Improving the GPA (瞎搞)
- 2015 Multi-University Training Contest 8 hdu 5385 The path
- POJ 2241 The Tower of Babylon
- k8s报错:Error from server (NotFound): the server could not find the requested resource (get services h
- The connection to the server ip:6443 was refused - did you specify the right host or port
- error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is cu
- The goal you specified requires a project to execute but there is no POM in this directory
- Android 4.4 KitKat, the browser and the Chrome WebView
- Comparing the MSTest and Nunit Frameworks
- .NET错误The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework
- Input and Output-The input is all the sources of action for your app
- How to get the query string by javascript?
- jQuery:mouseover and Increase the Size of an Image
- The cast to value type 'System.Decimal' failed because the materialized value is null. Either the result type's generic parameter or the query must use a nullable type.
- 【POJ 2942】Knights of the Round Table(点双连通分量,二分图染色)
- jsp头部报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- 查询排序:order by case when理解(根据一个字段的多个值进行排序)、在order By子句中使用case语句的理解、ORDER BY 2 DESC 中 2 的理解
- Xcode - Your development team, "", does not support the Push Notifications capability.
- Solve Warning: The elevation provided <Paper elevation={24}> is not available in the theme.
- [LeetCode] 1154. Day of the Year 一年中的第几天
- The declared package does not match the expected package
- Redis: under the hood---转载
- C#-DevExpress-How to get value from the control inside DropDownWindowTemplate
- The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'