设置方法
以新版 Powershell Core 即 Pwsh 为例,在命令行中设置当前会话代理 Proxy 的方法为(假设代理地址为 http://127.0.0.1:12345
):
1$env:HTTP_PROXY="http://127.0.0.1:12345"; $env:HTTPS_PROXY="http://127.0.0.1:12345"
2# or
3$env:ALL_PROXY ="http://127.0.0.1:12345"
参考链接
- Bypass proxy for all web requests in Powershell Core
- MS Learn - HttpClient.DefaultProxy Property
- Use the Az PowerShell module behind a proxy
- Powershell命令行设置代理
版权声明:本文遵循 CC BY-SA 4.0 版权协议,转载请附上原文出处链接和本声明。
Copyright statement: This article follows the CC BY-SA 4.0 copyright agreement. For reprinting, please attach the original source link and this statement.