I am trying to execute from powershell the Visual Studio's tool MSTest with no success:
$testDLL = "myTest.dll"
$mstestPath = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\mstest.exe"
$arguments = " /testcontainer:" + $testDLL + " /test:UnitTest1"
Invoke-Expression "$mstestPath $arguments"
I get this error: "The term 'x86' is not recognized as the name of a cmdlet, function,..." Any idea? Thanks.
Edit:
Ok, the problem was solved using "&" instead "Invoke-Expression" and creating separated variables for each argument, it doesn't work for me just using both in one var:
$testDLL = "myTest.dll"
$mstestPath = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\mstest.exe"
$argument1 = "/testcontainer:" + $testDLL
$argument2 = "/test:UnitTest1"
& $mstestPath $argument1