🦙
🦙
Update Windows Environment Variables from Powershell
Powershell makes it extremely easy to update the current session’s environmental variables by just reading and writing from $env:VARIABLE
But updating the systems default environment variables requires you to update the registry. Here’s the snippet to do that:
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINESystemCurrentControlSetControlSession ManagerEnvironment' `
-Name VARIABLENAME `
-Value VARIABLEVALUE