---
title: "Execute VSTest Tests"
---
Runs VSTest unit tests on a specified test project, recommended for tests in VS 2012 and later.
WindowsSDK::Execute-VSTest(
	TestContainer: <text>,
	[Group: <text>],
	[Arguments: <text>],
	[ClearExistingTestResults: <true/false>],
	[VsTestPath: <text>]
);
| Name | Format | Script Usage | Usage Notes | 
|---|---|---|---|
| ☆ Test container | text | TestContainer | This argument is required. | 
| Test group | text | Group | Value note: "Unit Tests". | 
| Additional arguments | text | Arguments | |
| Clear existing results | true/false | ClearExistingTestResults | When true, the test results directory will be cleared before the tests are run. | 
| VSTest Path | text | VsTestPath | The path to vstest.console.exe, typically: %VSINSTALLDIR%\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe Leave this value blank to auto-detect the latest vstest.console.exe using vswhere.exe. Default value is "$VSTestExePath". |