mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Ansible.ModuleUtils.FileUtil: catch DirectoryNotFoundException when testing a path (#37968)
This commit is contained in:
parent
63da50e1d8
commit
68e44e082e
3 changed files with 22 additions and 1 deletions
|
@ -17,7 +17,7 @@ Function Test-AnsiblePath {
|
|||
# Replacement for Test-Path
|
||||
try {
|
||||
$file_attributes = [System.IO.File]::GetAttributes($Path)
|
||||
} catch [System.IO.FileNotFoundException] {
|
||||
} catch [System.IO.FileNotFoundException], [System.IO.DirectoryNotFoundException] {
|
||||
return $false
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue