Skip to content

Commit 182fbef

Browse files
AnnaOparevaannaOpareva
and
annaOpareva
authored
Fix support VS old versions in VSBuildV1 task (#15271)
* fix old versions * bump version Co-authored-by: annaOpareva <[email protected]>
1 parent 6f23a7c commit 182fbef

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

Tasks/VSBuildV1/Get-VSPath.ps1

+10-9
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,26 @@ function Get-VSPath {
44
[Parameter(Mandatory = $true)]
55
[string]$Version)
66

7-
$Versions = @('15.0', '16.0', '17.0')
7+
$Versions = @('10.0', '11.0', '12.0','14.0','15.0', '16.0', '17.0')
88
Trace-VstsEnteringInvocation $MyInvocation
99

1010
try {
1111
if ( !($Version -in $Versions )) {
12-
Write-Warning "Please enter one of the versions 15.0, 16.0, 17.0"
13-
} else {
12+
Write-Warning "Please enter one of the versions 10.0, 11.0, 12.0, 14.0, 15.0, 16.0, 17.0"
13+
} else {
1414
$VersionNumber = [int]$Version.Remove(2)
1515
# Search for more than 15.0 Willow instance.
16+
if ($VersionNumber -ge 15) {
1617
if (($instance = Get-VisualStudio $VersionNumber) -and
17-
$instance.installationPath) {
18-
18+
$instance.installationPath) {
1919
return $instance.installationPath
20-
}
21-
20+
}
21+
}
22+
# Fallback to searching for an older install.
2223
if ($path = (Get-ItemProperty -LiteralPath "HKLM:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\$Version" -Name 'ShellFolder' -ErrorAction Ignore).ShellFolder) {
23-
return $path
24+
return $path
2425
}
25-
}
26+
}
2627
} finally {
2728
Trace-VstsLeavingInvocation $MyInvocation
2829
}

Tasks/VSBuildV1/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 192,
16-
"Patch": 2
16+
"Patch": 3
1717
},
1818
"demands": [
1919
"msbuild",

Tasks/VSBuildV1/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 192,
16-
"Patch": 2
16+
"Patch": 3
1717
},
1818
"demands": [
1919
"msbuild",

0 commit comments

Comments
 (0)