windows刷新环境变量

250 阅读1分钟
  • 在开发的时候需要写入环境变量,在 PowerShell 中不生效,但是在cmd中已经生效了

  • 刷新环境变量

$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")