Skip to content

Commit 164159f

Browse files
Update to 2022 msbuild path
1 parent b14d074 commit 164159f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Maverick.PCF.Builder/Scripts/MsBuild.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
Function Find-MsBuild([int] $MaxVersion = 2019)
1+
Function Find-MsBuild([int] $MaxVersion = 2022)
22
{
3+
$agentPath2022 = "$Env:programfiles\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\"
4+
$devPath2022 = "$Env:programfiles\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\"
5+
$proPath2022 = "$Env:programfiles\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\"
6+
$communityPath2022 = "$Env:programfiles\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\"
37
$agentPath2019 = "$Env:programfiles (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\"
48
$devPath2019 = "$Env:programfiles (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\"
59
$proPath2019 = "$Env:programfiles (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\"
@@ -12,6 +16,10 @@
1216
$fallback2013Path = "${Env:ProgramFiles(x86)}\MSBuild\12.0\Bin\"
1317
$fallbackPath = "C:\Windows\Microsoft.NET\Framework\v4.0.30319"
1418

19+
If ((2022 -le $MaxVersion) -And (Test-Path $agentPath2022)) { return $agentPath2022 }
20+
If ((2022 -le $MaxVersion) -And (Test-Path $devPath2022)) { return $devPath2022 }
21+
If ((2022 -le $MaxVersion) -And (Test-Path $proPath2022)) { return $proPath2022}
22+
If ((2022 -le $MaxVersion) -And (Test-Path $communityPath2022)) { return $communityPath2022 }
1523
If ((2019 -le $MaxVersion) -And (Test-Path $agentPath2019)) { return $agentPath2019 }
1624
If ((2019 -le $MaxVersion) -And (Test-Path $devPath2019)) { return $devPath2019 }
1725
If ((2019 -le $MaxVersion) -And (Test-Path $proPath2019)) { return $proPath2019 }

0 commit comments

Comments
 (0)