microsoft / vssetup.powershell

PowerShell module to interact with Visual Studio Setup
MIT License
233 stars 41 forks source link

Select-VSSetupInstance does not return Build Tools instances #56

Closed pianomanjh closed 5 years ago

pianomanjh commented 5 years ago

For build agents, typically one will install just build tools, and not full Visual Studio.
In my situation, I have VS2017 (full) and VS2019 build tools installed on the agent, Get-VSSetupInstance nicely returns:

InstanceId          : b58ec7ca
DisplayName         : Visual Studio Build Tools 2019
InstallationVersion : 16.3.29403.142
InstallationPath    : C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
InstallDate         : 10/9/2019 9:39:06 PM

InstanceId          : ed899074
DisplayName         : Visual Studio Professional 2017
InstallationVersion : 15.9.28307.770
InstallationPath    : C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
InstallDate         : 10/17/2017 8:06:13 PM

However, if I pipe that to Select-VSSetupInstance -Latest, I only get back the VS2017 instance, which is not the latest.

It seems the Select-VSSetupInstance function only returns retail install instances?

Thanks

heaths commented 5 years ago

Per the description of Select-VSSetupInstance,

You can specify zero or more products (by default, Visual Studio Community, Professional, and Enterprise are selected)... This is by design, and congruent with vswhere. Both were designed to find instances of the Visual Studio ID. If you want to find other products the installer installs, you can pass -Product *.