From 4831987c87e61045a4e895e5fa91532caf27cf21 Mon Sep 17 00:00:00 2001 From: SIMONE LEONTE Date: Mon, 11 Oct 2021 13:05:04 +0200 Subject: [PATCH] Update win_audit_rule.ps1 bugfixes: - win_audit_rule - Fix exception when trying to change a rule on a hidden or protected system file - https://github.com/ansible-collections/community.windows/issues/17 -https://github.com/ansible/ansible/issues/67642 --- lib/ansible/modules/windows/win_audit_rule.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/windows/win_audit_rule.ps1 b/lib/ansible/modules/windows/win_audit_rule.ps1 index 0d3ebf57b3806c..64061f90569204 100644 --- a/lib/ansible/modules/windows/win_audit_rule.ps1 +++ b/lib/ansible/modules/windows/win_audit_rule.ps1 @@ -66,7 +66,7 @@ Catch { } #get the path type -$ItemType = (Get-Item $path).GetType() +$ItemType = (Get-Item $path -Force).GetType() switch ($ItemType) { ([Microsoft.Win32.RegistryKey]) {$registry = $true; $result.path_type = 'registry'}