forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollect_vsinfo.ps1
65 lines (51 loc) · 1.8 KB
/
collect_vsinfo.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<#
.PARAMETER ArchiveRunName
Name of the run for vs logs
.NOTES
Returns 0 if succeeds, 1 otherwise
#>
[CmdletBinding(PositionalBinding=$false)]
Param (
[Parameter(Mandatory=$True)]
[string] $ArchiveRunName
)
. $PSScriptRoot/common/tools.ps1
$ProgressPreference = "SilentlyContinue"
$LogDir = Join-Path $LogDir $ArchiveRunName
mkdir $LogDir
$vscollect_uri="http://aka.ms/vscollect.exe"
$vscollect="$env:TEMP\vscollect.exe"
if (-not (Test-Path $vscollect)) {
Retry({
Write-Host "GET $vscollect_uri"
Invoke-WebRequest $vscollect_uri -OutFile $vscollect -UseBasicParsing
})
if (-not (Test-Path $vscollect)) {
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Unable to download vscollect."
exit 1
}
}
&"$vscollect"
Move-Item $env:TEMP\vslogs.zip "$LogDir"
$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
if (-not (Test-Path -Path "$vswhere" -PathType Leaf))
{
Write-Error "Couldn't locate vswhere at $vswhere"
exit 1
}
&"$vswhere" -all -prerelease -products * | Tee-Object -FilePath "$LogDir\vs_where.log"
$vsdir = &"$vswhere" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (-not (Test-Path $vsdir))
{
$procDumpDir = Join-Path $ToolsDir "procdump"
$procDumpToolPath = Join-Path $procDumpDir "procdump.exe"
$procdump_uri = "https://download.sysinternals.com/files/Procdump.zip"
if (-not (Test-Path $procDumpToolPath)) {
Retry({
Write-Host "GET $procdump_uri"
Invoke-WebRequest $procdump_uri -OutFile "$TempDir\Procdump.zip" -UseBasicParsing
})
Expand-Archive -Path "$TempDir\Procdump.zip" $procDumpDir
}
&"$procDumpToolPath" -ma -accepteula VSIXAutoUpdate.exe "$LogDir"
}