/PsBuild

A few MSBuild targets to run a PowerShell script after building your projects.

Primary LanguagePowerShell

PsBuild

A few MSBuild targets to run a PowerShell script after building your projects.

Getting started

Download the latest release and copy the targets and props files to the root folder that contains your source. How it works.

PsBuild.targets creates and runs the PS1 script at <SolutionDir>\.vs\<SolutionFileName>.ps1. and redirects PowerShell output to Visual Studio Output window. Use the link in the Properties folder for quick access to the script.

Scripts

A basic PS1 script might look like below. MSBuild properties are accessible via environment variables. There are more samples, including copying files and accessing remote machines.

# return
	
switch($env:ProjectName)
{
    "Project1" { "$_ : $env:TargetFramework : $env:TargetDir"  }
    "Project2" { dir env: }
  # "Project3" { }
}