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
}

posted @ 2025-06-16 09:25  从雍和宫走到电影学院  阅读(31)  评论(0)    收藏  举报