Add functions to find Program Files folders on the powershell side

This commit is contained in:
Alexander Karatarakis 2017-02-14 16:53:29 -08:00
parent a7c5063d4d
commit 444f28dd24
4 changed files with 28 additions and 2 deletions

View File

@ -18,7 +18,9 @@ foreach ($instance in $VisualStudio2017InstallationInstances)
}
# VS2015
$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}"
$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1
$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1
$CandidateProgramFiles = $programFiles32, $programFilesP
foreach ($ProgramFiles in $CandidateProgramFiles)
{
$clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\\VC\bin\cl.exe"

View File

@ -4,7 +4,9 @@ param(
)
$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}"
$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1
$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1
$CandidateProgramFiles = $programFiles32, $programFilesP
# Windows 10 SDK
foreach ($ProgramFiles in $CandidateProgramFiles)

View File

@ -0,0 +1,11 @@
[CmdletBinding()]
param(
)
if (Test-Path env:PROGRAMFILES`(X86`))
{
return ${env:PROGRAMFILES(X86)}
}
return ${env:PROGRAMFILES}

View File

@ -0,0 +1,11 @@
[CmdletBinding()]
param(
)
if (Test-Path env:ProgramW6432)
{
return ${env:ProgramW6432}
}
return ${env:PROGRAMFILES}