If you want to build you’re Microsoft Visual Studio 2010 setup project in release mode, from the command line, you can use the following PowerShell function:

function RebuildSubsystem([string]$solutionPath, [string]$projectPath, [string]$devEnvPath)
    $parameters = "/Rebuild Release ""$solutionPath"" /Project ""$projectPath"" /ProjectConfig Release"
    "Process to start [$devEnvPath $parameters]"
    $process = [System.Diagnostics.Process]::Start( "$devEnvPath", $parameters )


To call the function use:

RebuildSubsystem "C:\Projects\MyApplication\MyApplication.sln" "C:\Projects\MyApplication\MyApplication.Setup\MyApplication.Setup.vdproj" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"


  1. I am using VS 2013 and I got it to work using this:

    $solutionPath = “Your solution path”
    $devEnvPath = “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe”

    $parameters = “””$solutionPath”” /Rebuild”
    “Process to start [$devEnvPath $parameters]”
    $process = [System.Diagnostics.Process]::Start( “$devEnvPath”, $parameters )


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.