Merge pull request #1407 from dreamcat4/feature/fix-key-default-value
win_regedit: fixes #1404
This commit is contained in:
commit
80737755ea
1 changed files with 9 additions and 1 deletions
|
@ -57,8 +57,16 @@ if($state -eq "present") {
|
|||
{
|
||||
if (Test-RegistryValueData -Path $registryKey -Value $registryValue)
|
||||
{
|
||||
if ($registryValue.ToLower() -eq "(default)") {
|
||||
# Special case handling for the key's default property. Because .GetValueKind() doesn't work for the (default) key property
|
||||
$oldRegistryDataType = "String"
|
||||
}
|
||||
else {
|
||||
$oldRegistryDataType = (Get-Item $registryKey).GetValueKind($registryValue)
|
||||
}
|
||||
|
||||
# Changes Data and DataType
|
||||
if ((Get-Item $registryKey).GetValueKind($registryValue) -ne $registryDataType)
|
||||
if ($registryDataType -ne $oldRegistryDataType)
|
||||
{
|
||||
Try
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue