Why Choose psake?
Powerful features designed for modern build automation
Task Dependencies
Define clear dependencies between tasks for organized, predictable builds
Task Deploy -Depends Build, Test {
# Deploy only after build and test succeed
}
Cross-Platform
Runs on Windows, macOS, and Linux with PowerShell 7+
# Works everywhere PowerShell runs
Task Build {
dotnet build -c Release
}
Simple Syntax
Clean, readable task definitions that are easy to understand and maintain
Task Clean {
Remove-Item ./bin -Recurse -Force
}
Built-in Assertions
Validate conditions and fail fast with helpful error messages
Task Deploy {
Assert (Test-Path ./build) "Build folder required"
}
CI/CD Ready
Integrates seamlessly with GitHub Actions, Azure DevOps, and Jenkins
# GitHub Actions
- run: Invoke-psake -taskList CI
shell: pwsh
Flexible Properties
Configure builds with properties and override them at runtime
Properties {
$Configuration = "Release"
}
# Override: Invoke-psake -properties @{Configuration="Debug"}
Preconditions
Skip tasks conditionally based on your build environment
Task Deploy -Precondition { $Env -eq "Prod" } {
# Only runs in production
}
PowerShell Ecosystem
Use any PowerShell module or script in your build tasks
Task Test {
Invoke-Pester -Path ./tests
# Use Pester, PSScriptAnalyzer, etc.
}
See psake in Action
Real-world examples showing how psake simplifies build automation
A basic build workflow with dependencies
# Simple psakeFile.ps1
Task Default -Depends Build
Task Build -Depends Clean, Compile {
Write-Host "Build completed!" -ForegroundColor Green
}
Task Clean {
Remove-Item ./bin -Recurse -Force -ErrorAction Ignore
}
Task Compile {
dotnet build -c Release
}
psake version 4.9.0
Copyright (c) 2010-2024 James Kovacs & Contributors
Executing Clean
Executing Compile
Executing Build
Build completed!
Build Succeeded!
Get Started in 3 Steps
Start automating your builds in minutes
Install psake
Install psake from the PowerShell Gallery
Install-Module -Name psake -Scope CurrentUser
Create psakeFile.ps1
Define your build tasks in a psakeFile.ps1
Task Default -Depends Build
Task Build {
Write-Host "Building project..." -ForegroundColor Green
# Your build logic here
}
Run Your Build
Execute psake to run your tasks
Invoke-psake