Hi everyone I am trying to fetch the version of Microsoft Visual Studio components from powershell I tried "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property catalog_productDisplayVersion command But its working only on 'command Prompt'
I ran this command, "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property catalog_productDisplayVersion
output: At line:1 char:72
- ... x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property catalog ...
-
~~~~~~~~~
Unexpected token '-property' in expression or statement. At line:1 char:82
- ... Studio\Installer\vswhere.exe" -property catalog_productDisplayVersion
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'catalog_productDisplayVersion' in expression or statement. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : UnexpectedToken
Prefix the command with the PowerShell "Call Operator", which is an ampersand:
It prevents PowerShell from trying to parse the string.