Fix win_reg_stat for HKU hives (#59359)
(cherry picked from commit 2f2b106423
)
This commit is contained in:
parent
ffa92f7725
commit
e5f68cad5a
3 changed files with 16 additions and 1 deletions
2
changelogs/fragments/win_reg_stat-hku.yaml
Normal file
2
changelogs/fragments/win_reg_stat-hku.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- win_reg_stat - fix issue when trying to check keys in ``HKU:\`` - https://github.com/ansible/ansible/issues/59337
|
|
@ -80,7 +80,7 @@ $registry_hive = switch(Split-Path -Path $path -Qualifier) {
|
|||
"HKCC:" { [Microsoft.Win32.Registry]::CurrentConfig }
|
||||
"HKCU:" { [Microsoft.Win32.Registry]::CurrentUser }
|
||||
"HKLM:" { [Microsoft.Win32.Registry]::LocalMachine }
|
||||
"HKU" { [Microsoft.Win32.Registry]::Users }
|
||||
"HKU:" { [Microsoft.Win32.Registry]::Users }
|
||||
}
|
||||
|
||||
$key = $null
|
||||
|
|
|
@ -362,3 +362,16 @@
|
|||
assert:
|
||||
that:
|
||||
- not actual.exists
|
||||
|
||||
# Tests https://github.com/ansible/ansible/issues/59337
|
||||
- name: test out all registry hives
|
||||
win_reg_stat:
|
||||
path: '{{ item }}'
|
||||
register: reg_hive_stat
|
||||
failed_when: not reg_hive_stat.exists
|
||||
with_items:
|
||||
- HKCR:\*
|
||||
- HKCC:\Software
|
||||
- HKCU:\Software
|
||||
- HKLM:\Software
|
||||
- HKU:\.DEFAULT
|
||||
|
|
Loading…
Reference in a new issue