开启代理
function on {
$env:HTTP_PROXY = "http://127.0.0.1:8080"
$env:HTTPS_PROXY = "http://127.0.0.1:8080"
$env:ALL_PROXY = "socks5://127.0.0.1:8081"
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
}