Thus, one has that path already before editing the file..bash_profile is used only by the login shell.
If you edit that file and simply open another Terminal, you will see no change..bashrc is sourced by every interactive shell, but nested shells would repeat same FOO=bar:$FOO.
Now apply the new value: Set-Item Property -Path ‘Registry:: HKEY_LOCAL_MACHINE\System\Current Control Set\Control\Session Manager\Environment’ -Name PATH -Value $new Path Now do one final check that it looks how you expect it: Get-Item Property -Path ‘Registry:: HKEY_LOCAL_MACHINE\System\Current Control Set\Contro l\Session Manager\Environment’ -Name PATH).
Path You can now restart your powershell terminal (or even reboot machine) and see that it doesn’t rollback to it’s old value again.
Environment Variable Target]:: User ) ### from comments ### ### Usage from comments - Add to the system environment variable ### [Environment]:: Set Environment Variable("Path", $env: Path "; C:\bin", [Environment Variable Target]:: Machine) Although the current accepted answer works in the sense that the path variable gets permanently updated from the context of Power Shell, it doesn't actually update the environment variable stored in the windows registry.