OStack程序员社区-中国程序员成长平台

标题: Setting Windows PowerShell environment variables [打印本页]

作者: 菜鸟教程小白    时间: 2022-4-23 21:07
标题: Setting Windows PowerShell environment variables

I have found out that setting the PATH environment variable affects only the old command prompt. PowerShell seems to have different environment settings. How do I change the environment variables for PowerShell (v1)?

Note:

I want to make my changes permanent, so I don't have to set it every time I run PowerShell. Does PowerShell have a profile file? Something like Bash profile on Unix?



Best Answer-推荐答案


If, some time during a PowerShell session, you need to see or to temporarily modify the PATH environment variable , you can type one of these commands:

$envath                             # shows the actual content
$envath = 'C:\foo;' + $envath     # attach to the beginning
$envath += ';C:\foo'                # attach to the end






欢迎光临 OStack程序员社区-中国程序员成长平台 (http://ostack.cn/) Powered by Discuz! X3.4