mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07: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:
parent
5e20fd0943
commit
e16e6313c7
12 changed files with 166 additions and 29 deletions
|
@ -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}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue