powershell走代理
06-16 发布 | 08-17 更新 | 浏览数 37
AI 摘要
"快速开启或关闭 HTTP/HTTPS 代理! 让 PowerShell 成为你的代理管理专家。点击了解如何使用简单的命令轻松切换代理状态。"
加入到启动脚本中
notepad $PROFILE
开启代理
function on { $env:HTTP_PROXY = “http://127.0.0.1:1087” $env:HTTPS_PROXY = “http://127.0.0.1:1087” $env:ALL_PROXY = “socks5://127.0.0.1:1086” Write-Host “HTTP/HTTPS Proxy on” -ForegroundColor Green }
关闭代理
function off { Remove-Item Env:HTTP_PROXY Remove-Item Env:HTTPS_PROXY Remove-Item Env:ALL_PROXY Write-Host “HTTP/HTTPS Proxy off” -ForegroundColor Green }
