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 {
33
33
New-Item - Path $installerDir - ItemType Directory - Force | Out-Null
34
34
}
35
35
Get-File - Url $vsWhereUrl - OutFile $vswherePath
36
- Add-Path $installerDir
37
36
}
38
37
39
38
$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 {
19
19
begin {
20
20
}
21
21
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 )) {
23
25
throw " vswhere is not available"
24
26
}
25
- $MSVCDirectory = vswhere - latest - products * - find " VC\Tools\MSVC"
27
+ $MSVCDirectory = & $vswherePath - latest - products * - find " VC\Tools\MSVC"
26
28
$selectedToolset = $null
27
29
$minor = $null
28
30
foreach ($toolset in (Get-ChildItem $MSVCDirectory )) {
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ function Add-Vs {
29
29
New-Item - Path $installerDir - ItemType Directory - Force | Out-Null
30
30
}
31
31
Get-File - Url $vsWhereUrl - OutFile $vswherePath
32
- Add-Path $installerDir
33
32
}
34
33
35
34
$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 {
19
19
begin {
20
20
}
21
21
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 )) {
23
25
throw " vswhere is not available"
24
26
}
25
- $MSVCDirectory = vswhere - latest - products * - find " VC\Tools\MSVC"
27
+ $MSVCDirectory = & $vswherePath - latest - products * - find " VC\Tools\MSVC"
26
28
$selectedToolset = $null
27
29
$minor = $null
28
30
foreach ($toolset in (Get-ChildItem $MSVCDirectory )) {
You can’t perform that action at this time.
0 commit comments