mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
windows: fix for checking locked system files (#30665)
* fix for checking locked system files * moved functions to share module util and created tests * fixed windows-paths test based on win_stat changes
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#Requires -Module Ansible.ModuleUtils.Legacy
|
||||
#Requires -Module Ansible.ModuleUtils.CommandUtil
|
||||
#Requires -Module Ansible.ModuleUtils.FileUtil
|
||||
|
||||
# TODO: add check mode support
|
||||
|
||||
@@ -27,11 +28,11 @@ $result = @{
|
||||
cmd = $raw_command_line
|
||||
}
|
||||
|
||||
If($creates -and $(Test-Path -Path $creates)) {
|
||||
if ($creates -and $(Test-FilePath -path $creates)) {
|
||||
Exit-Json @{msg="skipped, since $creates exists";cmd=$raw_command_line;changed=$false;skipped=$true;rc=0}
|
||||
}
|
||||
|
||||
If($removes -and -not $(Test-Path -Path $removes)) {
|
||||
if ($removes -and -not $(Test-FilePath -path $removes)) {
|
||||
Exit-Json @{msg="skipped, since $removes does not exist";cmd=$raw_command_line;changed=$false;skipped=$true;rc=0}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user