When you modify something in PowerShell’s env: drive directly, you’re modifying a Process environment variable. This will take effect in any child processes that you launch from that PowerShell window, but will not be persisted after PowerShell closes, nor will they apply to any processes that aren’t children of that PowerShell window. This is the same as using the SET command in a batch file.
[Environment]::SetEnvironmentVariable() , on the other hand, persists that setting by writing it to the registry (either in the HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE hives, depending on what you passed in for the third argument.)
Thanks for that explanation Dave - makes perfect sense. So it looks like I have to use the .Net framework Environment class if I want to set a persistent machine wide environment variable