Complete Guide to vswhere.exe Properties: How to Find and Use Visual Studio Instance Metadata
Understanding vswhere.exe Properties
If you are automating build pipelines, scripting Windows environment setups, or writing CI/CD workflows, Microsoft's vswhere.exe is the standard tool for locating Visual Studio installations on a machine. However, finding a comprehensive list of supported properties for the -property flag can be frustrating because official documentation primarily provides usage examples rather than a complete reference list.
How to Discover All Available vswhere Properties
Because Visual Studio instances vary based on installed workloads, channels, and versions, the available properties are dynamically generated. The most reliable way to inspect every property available for your installed Visual Studio instances is to export the installation details in JSON or XML format.
Run the following command in PowerShell or Command Prompt:
vswhere.exe -format jsonThis command outputs a JSON array containing every property key and its corresponding value for each detected Visual Studio installation. If you want to include preview or prerelease builds, add the -prerelease flag:
vswhere.exe -prerelease -format jsonKey vswhere.exe Properties Explained
Here is a detailed list of the most common properties returned by vswhere.exe and what they represent:
- instanceId: The unique instance identifier generated during installation (e.g.,
a1b2c3d4). - installDate: Timestamp indicating when Visual Studio was installed.
- installationName: The internal installation name identifier.
- installationPath: The absolute file path to the root folder of the Visual Studio installation (e.g.,
C:\Program Files\Microsoft Visual Studio\2022\Community). - installationVersion: The exact semantic build version of Visual Studio (e.g.,
17.8.34309.116). - isPrerelease: A boolean value (
1or0) indicating whether the instance is a Preview release. - displayName: The human-readable product name (e.g.,
Visual Studio Community 2022). - description: A brief description of the installed Visual Studio product edition.
- enginePath: The path to the Visual Studio setup engine executable.
- channelId: The release channel identifier (e.g.,
VisualStudio.17.Release). - channelUri: The URL source endpoint for channel updates.
- catalog_productLineVersion: The major product line release year (e.g.,
2022).
Querying Specific Properties via Command Line
When writing scripts, you usually need to extract a single property value without surrounding metadata. You can pass the property name to the -property switch:
vswhere.exe -latest -property installationPathTo capture this value inside a PowerShell script, assign the command output directly to a variable:
$vsPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPathFiltering by Required Components
If you need to query properties for an installation that contains specific workloads or components (such as C++ toolsets or .NET SDKs), combine the -requires switch with -property:
vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPathSummary
While Microsoft does not provide a single static lookup table for vswhere.exe properties due to their dynamic nature across different extensions and versions, executing vswhere.exe -format json will immediately reveal all property keys supported by your current machine. Any key found in that JSON output can be queried directly using the -property <propertyName> argument.