File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
extension/BuildPhpExtension/private Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ function Add-Vs {
3333 New-Item - Path $installerDir - ItemType Directory - Force | Out-Null
3434 }
3535 Get-File - Url $vsWhereUrl - OutFile $vswherePath
36- Add-Path $installerDir
3736 }
3837
3938 $instances = & $vswherePath - products ' *' - format json 2> $null | ConvertFrom-Json
Original file line number Diff line number Diff line change @@ -19,10 +19,12 @@ function Get-VsVersionHelper {
1919 begin {
2020 }
2121 process {
22- if ($null -eq (Get-Command vswhere - ErrorAction SilentlyContinue)) {
22+ $installerDir = Join-Path " ${env: ProgramFiles(x86)} \Microsoft Visual Studio" ' Installer'
23+ $vswherePath = Join-Path $installerDir ' vswhere.exe'
24+ if (-not (Test-Path $vswherePath )) {
2325 throw " vswhere is not available"
2426 }
25- $MSVCDirectory = vswhere - latest - products * - find " VC\Tools\MSVC"
27+ $MSVCDirectory = & $vswherePath - latest - products * - find " VC\Tools\MSVC"
2628 $selectedToolset = $null
2729 $minor = $null
2830 foreach ($toolset in (Get-ChildItem $MSVCDirectory )) {
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ function Add-Vs {
2929 New-Item - Path $installerDir - ItemType Directory - Force | Out-Null
3030 }
3131 Get-File - Url $vsWhereUrl - OutFile $vswherePath
32- Add-Path $installerDir
3332 }
3433
3534 $instances = & $vswherePath - products ' *' - format json 2> $null | ConvertFrom-Json
Original file line number Diff line number Diff line change @@ -19,10 +19,12 @@ function Get-VsVersionHelper {
1919 begin {
2020 }
2121 process {
22- if ($null -eq (Get-Command vswhere - ErrorAction SilentlyContinue)) {
22+ $installerDir = Join-Path " ${env: ProgramFiles(x86)} \Microsoft Visual Studio" ' Installer'
23+ $vswherePath = Join-Path $installerDir ' vswhere.exe'
24+ if (-not (Test-Path $vswherePath )) {
2325 throw " vswhere is not available"
2426 }
25- $MSVCDirectory = vswhere - latest - products * - find " VC\Tools\MSVC"
27+ $MSVCDirectory = & $vswherePath - latest - products * - find " VC\Tools\MSVC"
2628 $selectedToolset = $null
2729 $minor = $null
2830 foreach ($toolset in (Get-ChildItem $MSVCDirectory )) {
You can’t perform that action at this time.
0 commit comments