win: fixed checking prerequsitives.

This commit is contained in:
Shuai Lin 2016-12-15 15:18:20 +08:00
parent f0e5708b1b
commit 94f91ccd4d

View file

@ -190,8 +190,11 @@ function loginfo($msg) {
} }
function program_exists($exe) { function program_exists($exe) {
cmd.exe /c where.exe "$exe" 2>&1>$null try {
return $LASTEXITCODE -eq 0 Get-Command "$exe" -CommandType Application 2>&1>$null
} catch [CommandNotFoundException] {
}
return $?
} }
function to_unix_path($path) { function to_unix_path($path) {