powershell配置变量常见用法
https://www.cnblogs.com/liuyt/p/5677781.html
https://www.i4k.xyz/article/luoyooi/102990113
# Powershell设置环境变量# 查看所有环境变量
ls env:# 搜索环境变量
ls env:NODE*# 查看单个环境变量
$env:NODE_ENV# 添加/更新环境变量
$env:NODE_ENV=development# 删除环境变量
del evn:NODE_ENV
pwsh7设置变量
设置的是永久性变量
# Machine参数: 表示设置的是系统变量,而不是用户变量
[Environment]::SetEnvironmentVariable("变量名", "变量值", "Machine")
为Windows终端配置proxy变量--适用于cmd
参考:

# 配置带验证的http proxy
set HTTP_PROXY=http://user:password@proxy.domain.com:port# 不带验证的
set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080# 如果设置了验证
set HTTP_PROXY=http://proxy.com:port
set HTTP_PROXY_USER=username
set HTTP_PROXY_PASS=passwordset HTTPS_PROXY=http://proxy.com:port
set HTTPS_PROXY_USER=username
set HTTPS_PROXY_PASS=password# 清除proxy设置
set http_proxy=
set https_proxy=
为Windows终端配置proxy变量--适用于PowerShell
参考:

https://gist.github.com/famousgarkin/c5138b1e13ac41920d22
检查是否已有配置文件
# 检查是否已有配置文件
Test-path $profile

如果为false手动创建profile
# 手动创建profile
New-item –type file –force $profile# 使用记事本打开profile文件
notepad $profile
"proxy"配置正文
PowerShell不支持socks5
# 方案1: http_proxy
$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"## 带http认证的
$env:http_proxy="user:password@proxy.domain.com:port"
$env:https_proxy="user:password@proxy.domain.com:port"# 方案2: ALL_PROXY
$env:ALL_PROXY="socks5://127.0.0.1:1080"
