DEV Community

Dennis Zhang
Dennis Zhang

Posted on • Edited on

windows设置系统环境变量

PowerShell中

# 删除,临时
Remove-Item Env:HTTP_PROXY
# 设置
$env:HTTP_PROXY = "http://my-company-proxy.com"
# 保存和新会话 save and use your proxy for all new shells
setx HTTP_PROXY http://my-company-proxy.com
// 去除代理
setx HTTP_PROXY " "

#查看
$env:HTTP_PROXY
// 永久,需要权限
[System.Environment]::SetEnvironmentVariable("HTTP_PROXY", $null, "User")
// Windows PowerShell:

[System.Environment]::SetEnvironmentVariable("HTTP_PROXY", $null, "User")
[System.Environment]::SetEnvironmentVariable("HTTPS_PROXY", $null, "User")

// Command Prompt:
set HTTP_PROXY=
set HTTPS_PROXY=


临时添加一个node版本
$env:Path = "C:\swdtools\node20;" + $env:Path

Enter fullscreen mode Exit fullscreen mode

Top comments (0)