在PowerShell中重新加载路径 [英] Reload the path in powershell
本文介绍了在PowerShell中重新加载路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我有一个Powershell ISE的实例运行,我安装的东西,修改PATH或我修改它在Powershell之外的任何方式,那么我需要重新启动Powershell它看到更新的PATH变量。
If I have an instance of Powershell ISE running and I install something that modifies the PATH or I modify it in any way outside of Powershell then I need to restart Powershell for it to see the updated PATH variable.
有没有办法重新载入Powershell中的路径而不重新启动它?
Is there any way to reload the path from within Powershell without restarting it?
推荐答案
只是为了使 Rob的评论变亮:
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
这篇关于在PowerShell中重新加载路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文