Bowen Sui
Bowen Sui

Reputation: 51

Start debugging a Visual Studio Project using Powershell script

I used to open a solution file in Visual Studio, right click a project, select "Debug" -> "Start a new instance" to start a debug session.

Can I write a powershell script to automate this? To make things easier, the automation does not have to rebuild and Project, the script only needs to start a debug session in Visual Studio executing myApplication.debug.exe

Upvotes: 5

Views: 2213

Answers (1)

ScheuNZ
ScheuNZ

Reputation: 911

Visual Studio has a 'DebugExe' command-line parameter you can use to accomplish this.

param
(
    [Parameter(Mandatory = $false)]
    [String]
    $TargetFileName
)

& "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /command "Debug.Start" /debugexe "$TargetFileName"

Upvotes: 1

Related Questions