tools: add support for the -Prerelease VS locations (#1202)

take advantage of the switch parameter on the Cmdlet Get-VSSetupInstance from the vssetup module.
This commit is contained in:
Ben Wilkinson 2019-06-12 12:56:09 -06:00 committed by Dustin L. Howett (MSFT)
parent 1580c1e093
commit e60af3ba76

View File

@ -51,7 +51,9 @@ function Import-LocalModule
function Set-MsbuildDevEnvironment
{
[CmdletBinding()]
param()
param(
[switch]$Prerelease
)
$ErrorActionPreference = 'Stop'
@ -59,7 +61,7 @@ function Set-MsbuildDevEnvironment
Write-Verbose 'Searching for VC++ instances'
$vsinfo = `
Get-VSSetupInstance -All `
Get-VSSetupInstance -All -Prerelease:$Prerelease `
| Select-VSSetupInstance `
-Latest -Product * `
-Require 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64'