Created
November 23, 2021 15:41
-
-
Save catwhocode/ab20f12f7e5ff16349d719001f914241 to your computer and use it in GitHub Desktop.
Add new entry to the path environment variable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: | |
# https://stackoverflow.com/questions/17240725/setx-doesnt-append-path-to-system-path-variable/17247259 | |
$new_entry = 'd:\app' | |
$old_path = [Environment]::GetEnvironmentVariable('path', 'machine'); | |
$new_path = $old_path + ';' + $new_entry | |
[Environment]::SetEnvironmentVariable('path', $new_path,'Machine'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment