We have TFS 2015 server and also a build server with Visual Studio 2017 Ultimate. TFS agent is not able to detect VisualStudio or VsTest capabilities (as it should) but when added manually, there is still a problem.
When it comes to Visual Studio Test step then console shows the following error and fails:
c:\AgentTest\tasks\VSTest\1.0.30\VSTest.ps1
Unable to determine the location of vstest.console.exe
I added the following capabilities manually:
VisualStudio C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise VisualStudio_15.0 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise
VisualStudio_IDE C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE
VisualStudio_IDE_15.0 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE
VS150COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\
VSTest C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow
VSTest_15.0 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow