mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-20 23:30:22 -07:00
win_regedit: fix extra info coming into stdout (#31813)
This commit is contained in:
parent
87db43afce
commit
888de842b3
2 changed files with 39 additions and 2 deletions
|
@ -243,7 +243,7 @@ if ($state -eq "present") {
|
|||
if (-not (Test-Path -path $path)) {
|
||||
# the key doesn't exist, create it so the next steps work
|
||||
try {
|
||||
New-Item -Path $path -Type directory -Force -WhatIf:$check_mode
|
||||
$null = New-Item -Path $path -Type directory -Force -WhatIf:$check_mode
|
||||
} catch {
|
||||
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) {
|
||||
# the clear_key flag is set and name is null so delete the entire key
|
||||
try {
|
||||
Remove-Item -Path $path -Force -Recurse -WhatIf:$check_mode
|
||||
$null = Remove-Item -Path $path -Force -Recurse -WhatIf:$check_mode
|
||||
} catch {
|
||||
Fail-Json $result "failed to delete registry key at $($path): $($_.Exception.Message)"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue