From 8734611fbdbb8a49ff19f0eac8ad3053f9b46bb5 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 9 May 2016 08:30:31 -0500 Subject: [PATCH] (GH-723) Warn when can't find file 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. --- .../helpers/functions/Start-ChocolateyProcessAsAdmin.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/chocolatey.resources/helpers/functions/Start-ChocolateyProcessAsAdmin.ps1 b/src/chocolatey.resources/helpers/functions/Start-ChocolateyProcessAsAdmin.ps1 index 0b884fd0ad..5d3ef8fd45 100644 --- a/src/chocolatey.resources/helpers/functions/Start-ChocolateyProcessAsAdmin.ps1 +++ b/src/chocolatey.resources/helpers/functions/Start-ChocolateyProcessAsAdmin.ps1 @@ -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.