ExecCommand() now display 'file not found' if the path not exist
This commit is contained in:
parent
47329ea298
commit
fca51612cd
1 changed files with 2 additions and 1 deletions
|
@ -523,6 +523,7 @@ function DelFile {
|
|||
write-Host -ForegroundColor DarkRed $Error[0].Exception.Message
|
||||
}
|
||||
}
|
||||
|
||||
function ExecCommand {
|
||||
param (
|
||||
[cmdletbinding(
|
||||
|
@ -539,7 +540,7 @@ function ExecCommand {
|
|||
$args = $params.arguments.Replace("##mod_path##", $script:current_module_path)
|
||||
Write-Host -NoNewline "`tExecute : $path : "
|
||||
$path = Invoke-Expression """$($path)"""
|
||||
if ( -not (Test-Path $path) -and -not $path -eq "powershell" ) {
|
||||
if ( -not (Test-Path $path) -or -not $path -eq "powershell" ) {
|
||||
Write-Host -ForegroundColor Yellow "File not found"
|
||||
return
|
||||
}
|
||||
|
|
Reference in a new issue