Path testing was wrong
This commit is contained in:
parent
2d9dc9743b
commit
37bb194595
1 changed files with 4 additions and 3 deletions
|
@ -592,17 +592,18 @@ function ExecCommand {
|
||||||
$args = $params.arguments.Replace("##mod_path##", $script:current_module_path)
|
$args = $params.arguments.Replace("##mod_path##", $script:current_module_path)
|
||||||
Write-Host -NoNewline "`tExecute : $path : "
|
Write-Host -NoNewline "`tExecute : $path : "
|
||||||
$path = Invoke-Expression """$($path)"""
|
$path = Invoke-Expression """$($path)"""
|
||||||
if ( -not (Test-Path $path) -and -not $path -eq "powershell" ) {
|
if ( -not ((Test-Path $path) -or $path -eq "powershell") ) {
|
||||||
Write-Host -ForegroundColor Yellow "File not found"
|
Write-Host -ForegroundColor Yellow "File not found"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Start-Process -NoNewWindow -wait -filepath $path -ArgumentList $args
|
Start-Process -NoNewWindow -wait -filepath $path -ArgumentList $args
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host -NoNewLine -ForegroundColor Red "Error`n`t"
|
Write-Host -NoNewLine -ForegroundColor Red "Error`n`t"
|
||||||
write-Host -ForegroundColor DarkRed $Error[0].Exception.Message
|
Write-Host -ForegroundColor DarkRed $Error[0].Exception.Message
|
||||||
}
|
}
|
||||||
|
Write-Host "`n"
|
||||||
}
|
}
|
||||||
|
|
||||||
function ProcessModuleFile {
|
function ProcessModuleFile {
|
||||||
|
|
Reference in a new issue