Skip to content

Commit 3927a32

Browse files
committed
Debug installed components of VS 2019
1 parent 4ec328c commit 3927a32

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

eng/scripts/CodeCheck.ps1

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,45 @@ function LogError {
4242

4343
try {
4444
if ($ci) {
45+
$vswherePath = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe"
46+
if (-not (Test-Path $vswherePath)) {
47+
$vswherePath = "$PSScriptRoot/../modules/KoreBuild.Tasks/vswhere.exe"
48+
}
49+
50+
if (-not (Test-Path $vswherePath)) {
51+
# Couldn't use vswhere, return 'msbuild.exe' and let PATH do its thing.
52+
Write-Host -f Red "Could not find VSWhere. Relying on MSBuild to exist on PATH"
53+
}
54+
else {
55+
[string[]] $vswhereArgs = @('-latest', '-format', 'json', '-products', '*', '-prerelease', '-version', '[16.0, 17.0)')
56+
Write-Host -f Magenta "> $vswherePath $vsWhereArgs"
57+
& $vswherePath @vswhereArgs | Write-Host
58+
59+
$vswhereArgs += '-property', 'displayName', '-format', 'text', '-nologo'
60+
foreach ($requirement in
61+
"Microsoft.Net.Component.4.6.1.TargetingPack",
62+
"Microsoft.Net.Component.4.6.2.TargetingPack",
63+
"Microsoft.Net.Component.4.7.1.TargetingPack",
64+
"Microsoft.Net.Component.4.7.2.SDK",
65+
"Microsoft.Net.Component.4.7.2.TargetingPack",
66+
"Microsoft.Net.Component.4.7.TargetingPack",
67+
"Microsoft.VisualStudio.Component.Azure.Storage.Emulator",
68+
"Microsoft.VisualStudio.Component.VC.ATL",
69+
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
70+
"Microsoft.VisualStudio.Component.VC.v141.ATL",
71+
"Microsoft.VisualStudio.Component.VC.v141.x86.x64",
72+
"Microsoft.VisualStudio.Component.Windows10SDK.17134",
73+
"Microsoft.VisualStudio.Workload.ManagedDesktop",
74+
"Microsoft.VisualStudio.Workload.NativeDesktop",
75+
"Microsoft.VisualStudio.Workload.NetCoreTools",
76+
"Microsoft.VisualStudio.Workload.NetWeb",
77+
"Microsoft.VisualStudio.Workload.VisualStudioExtension") {
78+
$vsWhereArgs_Requires = $vsWhereArgs + '-requires', $requirement
79+
Write-Host -f Magenta "> $vswherePath $vsWhereArgs_Requires"
80+
& $vswherePath @vsWhereArgs_Requires | Write-Host
81+
}
82+
}
83+
4584
# Install dotnet.exe
4685
& $repoRoot/build.ps1 -ci -norestore /t:InstallDotNet
4786
}

0 commit comments

Comments
 (0)