Psake

psake is a Domain Specific Language written in PowerShell to create builds using a dependency pattern similar to Rake or MSBuild.

The current version of psake is 4.0

A build script consists of Tasks. Each Task is a function that can define dependencies on other Task functions.

The following is an example psake script:

Task default -Depends Build
Task Build -Depends Init,Clean,Compile{
   "build"
}
Task Compile -Depends Clean, Init {
   "compile"
}
Task Clean -Depends Init {
   "clean"
}
Task Init {
   "init"
}

psake executes the Task functions and enforces the dependencies between tasks. Since psake is written in a real programming language and not XML, you have a lot more freedom and flexibility in your build scripts. You can use all the features of PowerShell and the .NET framework within your build.

The output of running psake on the script above is shown below:

PS > .\psake.ps1 default.ps1
Executing task: Init
init
Executing task: Clean
clean
Executing task: Compile
compile
Executing task: Build
compile
Build Succeeded!
----------------------------------------------------------------------
Build Time Report
----------------------------------------------------------------------
Name    Duration
----    --------
Init    00:00:00.0140878
Clean   00:00:00.0113634
Compile 00:00:00.0334894
Build   00:00:00.1288015
Total:  00:00:00.4693739

psake is open-source and can be downloaded from: github
More information can be found on the psake wiki

History

May 2008 - psake originally written by James Kovacs as a PowerShell V1 script file

May 2009 - psake re-written as a PowerShell V2 module by Jorge Matos