powershell: appending a path to PATH env var permanently

using cmd.exe, i can append a path to the PATH env var permanently by

setx PATH "C:\Program Files (x86)\ErgoEmacs;%PATH%"

how do do this in PowerShell?

i know that for current session, i can do:

$env:path = $env:path + ";c:\Program Files (x86)\PHP"

and i know creating a perm env var i can use:

[Environment]::SetEnvironmentVariable("myY", "la la", "User")

but how to do the perm version that joins the old PATH?


∑ http://xahlee.org/

No comments:

Post a Comment