Closed marianleica closed 4 weeks ago
$env:Path += C:\azrez\"
does not persist outside of the powershell sessionThis is by design:
When you change environment variables in PowerShell, the change affects only the current session. Ref: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.4
To change values in the Machine or User scopes, you must use the methods of the System.Environment class. Ref: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.4#create-persistent-environment-variables-in-windows
After running $env:Path += "C:\azrez\" on some client machine it does not make the change to the system's environment variables.