-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(GH-375) HKCU may not have Environment
When attempting to expand or work with `HKCU:\Environment`, that can error due to not having an existing `Environment` key in HKCU. This can occur in certain Windows Server versions, such as Server Core which doesn't have the key. This can also happen in other situations as well. - In `Get-EnvironmentVariableNames`, when expanding from `HKCU:\Environment` and it fails, silently continue. - When attempting to remove variables at User scope for Get-ToolsLocation, fail those silently. - If you can't set the Get-ToolsLocation value for User scope, attempt Machine scope instead. - With `Install-ChocolateyEnvironmentVariable`, if the attempt to set to User scope fails and the user is an administrator, attempt to set it with Machine scope. Otherwise fail. - In `Get-EnvironmentVariable`, if the registry key is null, do not attempt to grab a value or close it.
- Loading branch information
1 parent
66b0107
commit b041d2d
Showing
4 changed files
with
32 additions
and
8 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
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
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
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