From 60e67651c32060ada2a2bfd0d52366cf91ef86cb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 24 Feb 2017 14:30:56 -0800 Subject: Improve functions that detect ProgramFiles in powershell --- scripts/getProgramFiles32bit.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts/getProgramFiles32bit.ps1') diff --git a/scripts/getProgramFiles32bit.ps1 b/scripts/getProgramFiles32bit.ps1 index fd7167191..6b71915b1 100644 --- a/scripts/getProgramFiles32bit.ps1 +++ b/scripts/getProgramFiles32bit.ps1 @@ -3,9 +3,15 @@ param( ) -if (Test-Path env:PROGRAMFILES`(X86`)) +$out = ${env:PROGRAMFILES(X86)} +if ($out -eq $null) { - return ${env:PROGRAMFILES(X86)} + $out = ${env:PROGRAMFILES} } -return ${env:PROGRAMFILES} \ No newline at end of file +if ($out -eq $null) +{ + throw "Could not find [Program Files 32-bit]" +} + +return $out \ No newline at end of file -- cgit v1.2.3