CLI tool
psake/psake avatar
psake/psake

psake: PowerShell build automation with task dependencies

A build automation tool written in PowerShell

1,620 stars264 forksPowerShellMIT

At a glance

What is it?
psake is a PowerShell build automation tool for teams already working with command-line scripts and MSBuild. It uses PowerShell syntax, named tasks, dependencies, and properties, but its documentation leaves some operational choices to the build author.
Who is it for?
Adopt psake when your build logic already belongs in PowerShell and you want named tasks with dependencies and MSBuild integration. Do not choose it if your team needs a non-PowerShell build file, a documented cross-platform workflow, or automatic dependency resolution beyond the task model shown here.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 54 days ago.
What is it written in?
Mainly PowerShell, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

psake targets PowerShell build scripts

psake addresses build automation for developers who already understand PowerShell and command-line tools. Its central design choice is that a build script is PowerShell code rather than an executable XML file. The README calls this the avoidance of the "angle-bracket tax" and presents psake as a tool that builds on existing command-line knowledge.

The intended audience is not limited to a particular application language. A team can use psake when build steps involve PowerShell, MSBuild, or other commands available in the environment. It is especially relevant for Windows development environments where PowerShell is already part of the toolchain. The README documents PowerShell 5.1 or later as the prerequisite. It also documents Visual Studio 2017 and later integration through automatic MSBuild discovery.

The tool is task-oriented. A build file defines named tasks and can declare dependencies between them. That model is familiar to developers who have used make-style tools, although psake expresses the behavior through PowerShell syntax. The project also includes example scripts for nested tasks, parallel tasks, parameters, pre-actions, post-actions, setup, teardown, required variables, and error continuation. Those filenames indicate a build scripting system with more structure than a single shell command list.

psake does not prescribe a complete application lifecycle in the README. It provides a way to organize commands into build tasks. Packaging, testing, cleaning, and tool discovery remain explicit responsibilities of the build file or the commands it calls.

psake tasks resolve through PowerShell

The documented execution path is straightforward. A `.ps1` build file contains `Task` declarations, and `Invoke-psake` runs the default task unless another task name is supplied. The example declares `Default` with dependencies on `Test` and `Package`, so the documented model is that a task can depend on other named tasks before its own body executes.

A task body is a PowerShell script block. In the first example, `Test` writes a status message and `Package` writes another message. In a real build file, those bodies can contain the commands needed by the project. The README also points to `Get-Help Invoke-psake -Full` for detailed help and examples, which is important because the quick-start script deliberately uses placeholders rather than showing a complete application build.

Properties blocks provide another part of the mechanism. The troubleshooting section explains that psake dot-sources these blocks into task scope at runtime. Variables assigned in a properties block can therefore be used by task script blocks. This runtime relationship creates a notable static-analysis limitation: PSScriptAnalyzer can report a variable as assigned but unused because it cannot see the later task-scope use.

The repository also contains examples for nested and parallel tasks. Their presence indicates support for organizing related work and running independent task bodies in parallel, but the README does not specify the scheduling rules, failure behavior, or ordering guarantees for every possible graph. Those details should be confirmed in the command help or the linked psake documentation before relying on them for a release pipeline.

Install psake with PowerShell Gallery or Chocolatey

The README calls installation from the PowerShell Gallery the recommended option. This installs the module for the current user and fits a workstation where the build is invoked interactively. PowerShell script execution may need to be enabled first.

Set the execution policy for the current user before creating or running a psake script:

powershell
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Install psake from the PowerShell Gallery:

powershell
Install-Module -Name psake -Scope CurrentUser

The README lists Chocolatey as an alternative:

bash
choco install psake

For manual installation, the README directs users to the releases page, then says to unblock the downloaded zip file before extracting it. After extraction, import the module file from the current directory:

powershell
Import-Module .\psake.psm1

The releases page is also the source for release-specific downloads. The README does not document a version pin for the PowerShell Gallery command, a package integrity command, or an automated installation procedure for build agents. Those details are absent from the documentation rather than evidence that they are unnecessary.

Create and run a first psakefile

Create a file named `psakefile.ps1`. The following documented script defines a default task and its two dependencies:

powershell
Task Default -Depends Test, Package

Task Test {
    Write-Host "Running tests..."
}

Task Package {
    Write-Host "Creating package..."
}

Run it from the directory containing the build file:

powershell
Invoke-psake

The README says this runs the default task. The sample bodies only write status text, so a reader should see "Running tests..." and "Creating package..." in the terminal when the task dependencies execute. This is a syntax example, not a usable test or packaging implementation. The build author must replace the bodies with commands appropriate to the project.

The examples directory provides a way to inspect additional task forms. The README gives these commands:

powershell
cd .\examples
Invoke-psake
Invoke-psake .\psakefile.ps1 Clean

The first invocation runs the default task in the examples directory. The second passes an explicit build file and the `Clean` task name. The documented example files include `properties.ps1`, `parameters.ps1`, `nested.ps1`, `paralleltasks.ps1`, `preandpostaction.ps1`, `preandpostcondition.ps1`, and `tasksetupandteardown.ps1`. They are useful references when a basic task file is not enough.

psake properties can trigger analyzer false positives

The clearest documented failure mode involves PSScriptAnalyzer rather than the build itself. Because psake dot-sources `Properties` blocks into task scope, a variable can be assigned in one block and used later in a task. Static analysis may still report `PSUseDeclaredVarsMoreThanAssignments`, saying that the variable is assigned but never used.

The README recommends declaring script-scoped variables with the `$script:` prefix:

powershell
Properties {
    $script:build_dir = "c:\build"
    $script:connection_string = "datasource=localhost;..."
}

Task Compile {
    "Building to: $build_dir"
}

According to the README, the prefix does not change runtime behavior in this case, but it satisfies PSScriptAnalyzer's static requirements. This is an example of a tool interaction that can affect editor checks and quality gates even when the build script works. A team with required static analysis should test its existing analyzer rules against the properties pattern before adding it to CI.

The documentation also exposes a broader boundary. psake scripts rely on PowerShell scope and dot-sourcing behavior. Moving build logic into another environment, changing execution policy, or wrapping commands in a runner that does not load the module can produce setup failures before task logic is reached. The README does not document rollback behavior or a centralized execution wrapper, so neither should be assumed.

MSBuild integration depends on Visual Studio tooling

psake has a documented path into MSBuild. For Visual Studio 2017 and later, the README says psake can automatically locate MSBuild. This makes the tool relevant for.NET-oriented build steps where an existing Visual Studio installation supplies the executable.

There is a stated contingency. If MSBuild discovery causes issues, the README points to the `VSSetup` PowerShell module:

powershell
Install-Module -Name VSSetup -Scope CurrentUser

That contingency adds an installation step to the build environment. The README does not say which versions of `VSSetup` are supported, whether discovery is configurable, or how psake behaves when no supported Visual Studio instance exists. Automatic discovery should therefore be checked on each developer machine and on CI images rather than treated as portable behavior.

For teams that do not use Visual Studio, psake can still run ordinary PowerShell tasks, but the README does not document a separate cross-platform MSBuild configuration. The tool's core syntax is PowerShell-based, while the stated MSBuild integration is tied to Visual Studio 2017 and later. That distinction matters when selecting it for a mixed operating-system pipeline.

psake maintenance and release choices need review

The repository is not archived, and the last push was on 2026-08-30. That is the most recent maintenance fact in the repository record. The release list includes `v5.0.0-alpha`, labeled Alpha, dated 2026-03-21, as well as `v4.9.1`, dated 2024-10-06, and `v4.9.0`, dated 2019-09-21. The presence of an Alpha release is a concrete upgrade consideration, not a claim about stability.

The MIT license gives the project an open-source license with permission and notice obligations described by the license itself. This article does not provide legal advice. Teams should review the actual `LICENSE` file when distributing psake or embedding it in an internal tooling distribution.

The upgrade cost appears concentrated in module installation and build-script compatibility. The README does not document a migration guide for moving from the stable releases to `v5.0.0-alpha`, nor does it provide a compatibility matrix. It links to the releases section and `CHANGELOG.md` for release information. A team considering the Alpha line should inspect those files and test the commands used by its own build before changing a shared automation environment.

Editorial conclusion

Adopt psake when your build logic already belongs in PowerShell and you want named tasks with dependencies and MSBuild integration. Do not choose it if your team needs a non-PowerShell build file, a documented cross-platform workflow, or automatic dependency resolution beyond the task model shown here. Check PowerShell 5.1 compatibility, execution policy, task ordering, and the effect of dot-sourced properties on your existing scripts first. The MIT license permits use under its terms, while the last push was on 2026-08-30 and v5.0.0 is marked Alpha.

Frequently asked questions

How do I install psake in PowerShell?

The README lists `Install-Module -Name psake -Scope CurrentUser` as the recommended installation method. It requires PowerShell 5.1 or later and says the execution policy must allow script execution.

How do I create and run a first psake build?

Create a `psakefile.ps1` file with `Task` declarations, then run `Invoke-psake` from that directory. The README's example defines `Default -Depends Test, Package` and shows task bodies using `Write-Host`.

Can psake find MSBuild automatically?

The README says psake can automatically locate MSBuild for Visual Studio 2017 and later. If discovery has issues, it points to installing the `VSSetup` PowerShell module.

Official sources

  1. License: MIT
  2. Project website
  3. psake/psake on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/psake-psake.svg)](https://hysenlabs.com/projects/psake-psake)

Was this useful?