I have an environment variable set via "system properties -> advanced -> Environment Variables". I modified the variable's value. In cmd, I see the new value. In PowerShell, the value is still the old value. Trying to set it with [Environment]::SetEnvironmentVariable doesn't have any effect.
PowerShell: can’t modify environment variables
environment-variablespowershell
Best Answer
PowerShell will cache its information. Use the Refresh method to solve your problem. I found this in the SQL area too.