mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Ansible.ModuleUtils.FileUtil: catch DirectoryNotFoundException when testing a path (#37968)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user