Visual Studio – Command Task Runner

email me

This Visual Studio extension adds support for command line batch files in Visual Studio 2015’s Task Runner Explorer.

Supports .exe, .cmd, .bat, .ps1 and .psm1 files.

 

Add commands

The easiest way to add a batch file to Task Runner Explorer is to right-click it in Solution Explorer and select Add to Task Runner

You can right-click supported batch files in either solution folders or from within a any project.

Doing so will create a commands.json file. If you right-clicked a batch file in a solution folder, then the commands.json file will be placed in the solution folder. If the batch file is in a project you will be prompted to select to either put it in the project or solution folder.

If a commands.json file already exist, the new batch file will be added.

 

Execute scripts

When scripts are specified, the Task Runner Explorer will show those scripts.

Each script can be executed by double-clicking the task.

 

commands.json locations

The Task Runner Explorer supports multiple task runners in the same solution. For instance, you can have commands specified for the solution and additional ones for each project in that solution.

Task Runner Explorer will try to find a commands.json file in any parent folder to either the individual projects or the solution until it hits the root of the drive.

 

Commands

Inside commands.json it is possible to add custom scripts inside the “scripts” element.

{ “commands”: { “Build”: { “FileName”: “cmd.exe”, “WorkingDirectory”: “.”, “Arguments”: “/c build\build.cmd” } }}