forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chocolateyGH-303 Install-ChocolateyPath Expands Variables in PATH, Ov…
…erwriting Preexisting Variables When adding a new element to PATH, Install-ChocolateyPath reads PATH (wh ich contains expanded variables), appends the new element, and then writes the value back to PATH. This results in PATH having its variables overwritten with its values. Instead of reading $env:PATH to find the current path, read it from the registry, which will retain the PATH's original variables.
- Loading branch information
Showing
1 changed file
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
7773cac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would leave the actual getting of the path in Get-EnvironmentVariable, but add a switch for not expanding the variable.
7773cac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sure that makes more sense. Thanks.
7773cac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did this end up?
7773cac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminder. I'll be picking this up again.