January 25th, 2018

vswhere now supports -requiresAny to find instances with one or more components installed

Heath Stewart
Principal Software Engineer

The latest release of vswhere.exe supports a new switch parameter, -requiresAny (case-insensitive). This switch changes the behavior of -requires to return any instances that have one or more workloads or components installed.

As Visual Studio continues to add value with more features (including lots of partner content) targeting a wider variety of workloads, we made significant changes to better modularize the install. The refactoring effort was huge and some scenarios may not have been anticipated. As one example, vstest.console.exe is in a single package but we don’t recommend using package IDs in vswhere.exe because we may (and very often have) changed package IDs as refactoring continues. But in this example, the package in which vstest.console.exe ships can be found in two distinct workloads. Depending on your build environment, invoking vswhere.exe twice might been problematic, so -requiresAny can be useful like in the following example:

vswhere.exe -latest -requires Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.Web -requiresAny -property installationPath

See Find VSTest or related content in our wiki for more examples.

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.