当我这样做的时候:
[Environment]::GetEnvironmentVariable('Path') -split ';'
个
或
$env:path -split ';'
个
I get this result, which has bunch of duplicates
但当我从控制面板打开环境变量时,我看到以下内容:
我使用的是标准帐户,PowerShell也以标准帐户运行,试图修改当前用户的路径.
我try 关闭和重新打开PowerShell,然后重新启动计算机,但我仍然看到控制面板和PowerShell输出之间的值不同.为什么会这样呢?
p.s I previously used .NET in PowerShell to add a location to the path variable of my current standard user, and the variables weren't 或iginally like that, I was just trying some thing with them and ended up like that, but I cleaned the duplicates in control panel, I just can't get the PowerShell to show the c或rect cleaned version of them. I have no idea at which point I messed it up but I need to know why I'm getting different results.