Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (GH-1043) Fix: Set-EnvironmentVariable writes error when SYSTEM
  • Loading branch information
ferventcoder committed Mar 18, 2017
2 parents 2ab0b96 + e7ce79f commit f209c2b
Showing 1 changed file with 4 additions and 1 deletion.
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 f209c2b

Please sign in to comment.