PowerTip: Set Personal Environment Variable from PowerShell
Summary: Access the $ENV object in Windows PowerShell to alter personal environment settings.
How can I use Windows PowerShell to change a system environment variable such as the user %TEMP%?
You can read any personal environment settings by using $ENV:VariableName, then assigning a value.
For example, to change your personal %TEMP% to a new location, use:
Note This presumes C:\Foo exists and will alter the variable for the present PowerShell session.