[ad_1]
I found this script for finding where msbuild.exe is, but it’s not working. When I run it, it says “A parameter cannot be found that matches parameter name ‘latest'” https://github.com/microsoft/vswhere/wiki/Find-MSBuild
Here is my script:
$path = %ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | select-object -first 1
if ($path) {
& $path $args
}
Does anyone know what I’m doing wrong? I tried encapsulating the path in quotes, and putting it into a variable and tried using Invoke-Expression
but this also did not work. In bash all I would need to do is encapsulate the command with ` and it would work.
Invoke-Expression -Command "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
x86: The term 'x86' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
This also does not work
[ad_2]