Skip to content

Instantly share code, notes, and snippets.

@cmckni3
Last active January 3, 2024 20:19
Show Gist options
  • Save cmckni3/b85eb476e07c459f7a00932fecc01a6e to your computer and use it in GitHub Desktop.
Save cmckni3/b85eb476e07c459f7a00932fecc01a6e to your computer and use it in GitHub Desktop.
Psake notes

TeamCity and psake

What is psake

  • Open-source build automation tool
  • Powershell-based
  • Leverages existing command line knowledge
  • Replaces msbuild for most tasks

Installation

With an empty solution in Visual studio (2015):

A. Clone from source (https://github.com/psake/psake) B. NuGet package

We're going to use it as a NuGet package:

  1. Create a new "ClassLibrary" project in the solution (you could call it "Build" if you like)
  2. Install psake
Install-Package psake
  1. Create a new Powershell script with psake tasks
task default -depends Test

task Clean {
    Write-Host 'Executed Clean!'
}

task Compile -depends Clean {
    Write-Host 'Executed Compile!'
}

task Test -depends Compile, Clean {
    Write-Host 'Executed Test!'
}
  1. Run a psake task
Import-Module ..\packages\psake.4.6.0\tools\psake.psm1
Invoke-psake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment