March 5th, 2017

Fast acquisition of vswhere

Heath Stewart
Principal Software Engineer

I introduced vswhere last week as an easy means to locate Visual Studio 2017 and newer, along with other products installed with our new installer that provides faster downloads and installs – even for full installs (which has roughly doubled in size with lots of new third-party content).

vswhere was designed to be a fast, small, single-file executable you could download and even redistribute in a build pipeline or for other uses. To make this easy to acquire, I’ve published both a NuGet package and made vswhere available via Chocolatey.

[code gutter=”false”]choco install vswhere vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath[/code]

You might notice a few other surprises in that command line I’ve implemented for our first packaged release of 1.0.40.

  • You can pass a single “*” to -products to search all installed product instances. Note that the asterisk is not a wildcard that can be used for pattern matching.
  • You can specify a single property to return only that property value. In PowerShell and some other script environments that makes it very easy to capture into a variable.

You can also install using the Chocolatey package provider for PowerShell, but a bug in the provider does not put vswhere in your PATH.

See our wiki for more information.

Author

Heath Stewart
Principal Software Engineer

Heath is an application architect and developer, looking to help educate others to learn professional development. Besides designing and developing applications he enjoys writing about intermediate and advanced topics. Heath also consults for deployment packages and scenarios within Microsoft and for external customers.

0 comments

Discussion are closed.