Skip to content

Commit

Permalink
resets
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Jul 8, 2021
1 parent 52cc62d commit 7782c3b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 28 deletions.
4 changes: 1 addition & 3 deletions scripts/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ variables:
jobs:
- job: test
pool:
vmImage: $(VM_IMAGE_WINDOWS)
vmImage: windows-2019
steps:
- checkout: self
submodules: false
- pwsh: .\scripts\install-vs.ps1 -Version $env:VS_VERSION_PREVIEW
- script: vs_community.exe --quiet --norestart --wait --add Microsoft.VisualStudio.Workload.NetCrossPlat --add Microsoft.VisualStudio.Workload.NetCoreTools --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.Universal
- pwsh: .\scripts\install-vs2.ps1 -Version $env:VS_VERSION_PREVIEW
- task: PublishBuildArtifacts@1
inputs:
artifactName: output
Expand Down
40 changes: 39 additions & 1 deletion scripts/install-vs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,47 @@ Param(

$ErrorActionPreference = 'Stop'

$startTime = Get-Date

Write-Host "Downloading Visual Studio Installer..."
Invoke-WebRequest -UseBasicParsing `
-Uri "https://aka.ms/vs/install/latest/vs_setup.exe" `
-OutFile "$env:TEMP\dd_vs_setup.exe"

Write-Host "Updating the Visual Studio Installer..."
$exitCode = & "$env:TEMP\dd_vs_setup.exe" --update --quiet --wait | Out-Null

Write-Host "Exit code: $exitCode"

Write-Host "Downloading Visual Studio ($Version)..."
Invoke-WebRequest -UseBasicParsing `
-Uri "https://aka.ms/vs/$Version/vs_community.exe" `
-OutFile vs_community.exe
-OutFile "$env:TEMP\dd_vs_community.exe"

Write-Host "Installing Visual Studio..."
$exitCode = & "$env:TEMP\dd_vs_community.exe" --quiet --norestart --wait `
--add Microsoft.VisualStudio.Workload.NetCrossPlat `
--add Microsoft.VisualStudio.Workload.NetCoreTools `
--add Microsoft.VisualStudio.Workload.ManagedDesktop `
--add Microsoft.VisualStudio.Workload.Universal `
| Out-Null

Write-Host "Exit code: $exitCode"

$vsLogs = 'output\vs-logs'
New-Item -ItemType Directory -Force -Path "$vsLogs" | Out-Null
Get-ChildItem "$env:TEMP\dd_*" |
Where-Object { $_.CreationTime -gt $startTime } |
Copy-Item -Destination "$vsLogs"

$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"

Write-Host "Setting Environment Variables..."
$installationPath = & $vswhere -latest -prerelease -property installationPath
Write-Host "##vso[task.prependpath]$installationPath\MSBuild\Current\Bin"
Write-Host "##vso[task.setvariable variable=VS_INSTALL]$installationPath"

Write-Host "Installed Visual Studio Versions:"
& $vswhere -all -prerelease -property installationPath

exit $LASTEXITCODE
24 changes: 0 additions & 24 deletions scripts/install-vs2.ps1

This file was deleted.

0 comments on commit 7782c3b

Please sign in to comment.