|
|
|
@ -243,7 +243,7 @@ if ($state -eq "present") {
|
|
|
|
if (-not (Test-Path -path $path)) {
|
|
|
|
if (-not (Test-Path -path $path)) {
|
|
|
|
# the key doesn't exist, create it so the next steps work
|
|
|
|
# the key doesn't exist, create it so the next steps work
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
New-Item -Path $path -Type directory -Force -WhatIf:$check_mode
|
|
|
|
$null = New-Item -Path $path -Type directory -Force -WhatIf:$check_mode
|
|
|
|
} catch {
|
|
|
|
} catch {
|
|
|
|
Fail-Json $result "failed to create registry key at $($path): $($_.Exception.Message)"
|
|
|
|
Fail-Json $result "failed to create registry key at $($path): $($_.Exception.Message)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -330,7 +330,7 @@ $key_prefix[$path]
|
|
|
|
if ($delete_key -and $name -eq $null) {
|
|
|
|
if ($delete_key -and $name -eq $null) {
|
|
|
|
# the clear_key flag is set and name is null so delete the entire key
|
|
|
|
# the clear_key flag is set and name is null so delete the entire key
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Remove-Item -Path $path -Force -Recurse -WhatIf:$check_mode
|
|
|
|
$null = Remove-Item -Path $path -Force -Recurse -WhatIf:$check_mode
|
|
|
|
} catch {
|
|
|
|
} catch {
|
|
|
|
Fail-Json $result "failed to delete registry key at $($path): $($_.Exception.Message)"
|
|
|
|
Fail-Json $result "failed to delete registry key at $($path): $($_.Exception.Message)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|