-
Notifications
You must be signed in to change notification settings - Fork 99
Examples
vswhere.exe has been designed to be a flexible option to finding Visual Studio and other products like our standalone Build Tools. It can emit information in a variety of output formats to support a wide range of build and deployment tooling, such as batch scripts, make files, and PowerShell scripts - though in the latter case, I recommend you check out VSSetup.PowerShell for a more PowerShell-friendly option with even more capability than vswhere.
The following are merely useful examples for a variety of targeted scenarios. Contributions via pull requests for other common scenarios are welcome.
- Find MSBuild
- Find VC
- Find VSIXInstaller
- Find VSTest
- Start Developer Command Prompt
- Use .vsconfig File
For each of these examples, all versions of Visual Studio or other installed products instance are searched. You can always pass -version [15.0,16.0)
to limit your searches to a particular version. In this example, only 15.x versions will be searched. Read about Versions for more ways to specify a version range.
To find an instance or instances that have required workloads or components installed, you can pass any number to -requires
. By default, all specified IDs must be installed for an instance to be selected. If you want to select instances with any of those IDs installed, pass -requiresAny
.
See https://aka.ms/vs/workloads for a list of workloads and components with descriptions.
New with version 3.1.1 you can also use wildcards:
-
?
matches any one character -
*
matches zero or more of any characters
For example, if you need to find an instance with any Windows 10 SDK installed, you could call:
vswhere -requires Microsoft.VisualStudio.Component.Windows10SDK.*
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT license. See LICENSE.txt in the project root for license information.