Skip to content

Commit

Permalink
(GH-723) Warn when can't find file
Browse files Browse the repository at this point in the history
Instead of errorring when not able to find a file, choco should instead
pass a warning. Once we have search paths enabled like we do in c#, we
can revisit this.
  • Loading branch information
ferventcoder committed May 9, 2016
1 parent 274ac96 commit 8734611
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ Elevating Permissions and running [`"$exeToRun`" $wrappedStatements]. This may t
}

if (!([System.IO.File]::Exists($exeToRun)) -and $exeToRun -notmatch 'msiexec') {
Set-PowerShellExitCode 2
throw "Could not find '$exeToRun'"
Write-Warning "May not be able to find '$exeToRun'. Please use full path for executables."
# until we have search paths enabled, let's just pass a warning
#Set-PowerShellExitCode 2
#throw "Could not find '$exeToRun'"
}

# Redirecting output slows things down a bit.
Expand Down

0 comments on commit 8734611

Please sign in to comment.