Powershell 无法识别Path Powershell 如何更新Path

Posted 何大卫的博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Powershell 无法识别Path Powershell 如何更新Path相关的知识,希望对你有一定的参考价值。

问题

使用不用方式启动的 Powershell 得到的环境是不同的。通过以下命令查看。可将系统路径(Machine)和用户路径合并后设置未当前的环境变量

>> $env:path

解决

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

以上是关于Powershell 无法识别Path Powershell 如何更新Path的主要内容,如果未能解决你的问题,请参考以下文章