microsoft / vswhere

Locate Visual Studio 2017 and newer installations
MIT License
921 stars 97 forks source link

Products wildcard does not find VS2022 #254

Closed mastercoms closed 2 years ago

mastercoms commented 2 years ago

-products help states:

Defaults to Community, Professional, and Enterprise.
Specify "*" by itself to search all product instances installed.

However, when specifying *, it does not find VS2022.

./vswhere.exe -prerelease -latest -products * -property installationPath

It works when -products is not specified.

./vswhere.exe -prerelease -latest -property installationPath
C:\Program Files\Microsoft Visual Studio\2022\Enterprise

Also works if the ID is explicitly specified.

./vswhere.exe -prerelease -latest -products Microsoft.VisualStudio.Product.Enterprise -property installationPath
C:\Program Files\Microsoft Visual Studio\2022\Enterprise

I expect for the product to be listed with -products *.

mastercoms commented 2 years ago

Apologies, I did not escape * :)

heaths commented 2 years ago

For future viewers, escaping may not be necessary. It really depends on your shell or invocation environments e.g., in-code, in general. At least in cmd or PowerShell, I've never needed to escape *.