Adding a path to the PATH environment variable in the current PowerShell session is simpler than I thought:
> $env:path += ";path"
Note: remember to prepend the semi-colon to the new path make a valid path list.
You can make your PATH variable persistent using the SetEnvironmentVariable()
.Net method:
[System.Environment]::SetEnvironmentVariable("PATH", $Env:Path + ";path", "target")
… where target is "Machine", "User" or "Process". Check the .Net documentation for what these values mean.
Short and precise.
ReplyDeleteExemplary!
Thanks!
forjo
http://gallery.technet.microsoft.com/scriptcenter/3aa9d51a-44af-4d2a-aa44-6ea541a9f721
ReplyDelete