Skip to content

Commit

Permalink
Merge branch 'pr1044' into stable
Browse files Browse the repository at this point in the history
* pr1044:
  (GH-1043) Fix: Set-EnvironmentVariable writes error when SYSTEM
  • Loading branch information
ferventcoder committed Mar 18, 2017
2 parents 322b4eb + d24dbcb commit e7ce79f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ param (

[Microsoft.Win32.RegistryValueKind]$registryType = [Microsoft.Win32.RegistryValueKind]::String
try {
$registryType = $win32RegistryKey.GetValueKind($Name)
if ($win32RegistryKey.GetValueNames() -contains $Name)
{
$registryType = $win32RegistryKey.GetValueKind($Name)
}
} catch {
# the value doesn't yet exist
# move along, nothing to see here
Expand Down

0 comments on commit e7ce79f

Please sign in to comment.