mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
windows - Fix module utils with glob paths (#53835)
* windows - Fix module utils with glob paths * fix link util tests when using DOS 8.3 paths
This commit is contained in:
@@ -46,12 +46,12 @@ Function Get-ExecutablePath {
|
||||
$full_path = [System.IO.Path]::GetFullPath($executable)
|
||||
|
||||
if ($full_path -ne $executable -and $directory -ne $null) {
|
||||
$file = Get-Item -Path "$directory\$executable" -Force -ErrorAction SilentlyContinue
|
||||
$file = Get-Item -LiteralPath "$directory\$executable" -Force -ErrorAction SilentlyContinue
|
||||
} else {
|
||||
$file = Get-Item -Path $executable -Force -ErrorAction SilentlyContinue
|
||||
$file = Get-Item -LiteralPath $executable -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
if ($file -ne $null) {
|
||||
if ($null -ne $file) {
|
||||
$executable_path = $file.FullName
|
||||
} else {
|
||||
$executable_path = [Ansible.Process.ProcessUtil]::SearchPath($executable)
|
||||
@@ -93,7 +93,7 @@ Function Run-Command {
|
||||
# need to validate the working directory if it is set
|
||||
if ($working_directory) {
|
||||
# validate working directory is a valid path
|
||||
if (-not (Test-Path -Path $working_directory)) {
|
||||
if (-not (Test-Path -LiteralPath $working_directory)) {
|
||||
throw "invalid working directory path '$working_directory'"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user