Skip to main content
Open sourceCross-platformPowerShell 5.1 & 7.4+

Test your PowerShell.
Ship with confidence.

Pester is the ubiquitous test and mock framework for PowerShell — expressive syntax, powerful mocking and beautiful output, everywhere PowerShell runs.

WindowsLinuxmacOSAzure PipelinesGitHub Actions
Example of Pester test output showing passing and failing tests

Write your first test in seconds

Save a *.Tests.ps1 file, describe what your code should do, and run it. Pester handles discovery, execution and reporting.

Get-Planet.Tests.ps1
BeforeAll {
. $PSScriptRoot/Get-Planet.ps1
}

Describe 'Get-Planet' {
It 'lists all 8 planets' {
$planets = Get-Planet
$planets.Count | Should-Be 8
}
}
Pester console output with a passing test

Green when it passes — and a precise, readable diff the moment it doesn't.

Everything you need to test PowerShell

From a one-line assertion to validating entire environments — Pester scales with you.

Readable, expressive syntax

Describe, Context, It and Should read like plain English. Tests document intent instead of hiding it in boilerplate.

Powerful mocking

Replace any command with a mock, control what it returns, and assert exactly how it was called — no dependency injection required.

Built-in code coverage

See which lines your tests exercise and export JaCoCo or Cobertura reports your pipeline already understands.

Runs everywhere

PowerShell 7.4+ on Windows, Linux and macOS — test the same code everywhere it runs.

First-class VS Code

Run and debug tests straight from the Test Explorer, jump to failures, and scaffold tests with snippets.

CI/CD ready

Emit NUnit or JUnit results for GitHub Actions, Azure Pipelines, Jenkins and more. Fail the build when a test fails.

GitHub stars
PowerShell Gallery downloads
Latest Pester version

Pester is the standard test framework for PowerShell — trusted by the PowerShell project itself and teams across the ecosystem, including Microsoft and Azure.

PowerShell logoGitHub logoMicrosoft logoAzure logo

Logos are trademarks of their respective owners.

Meet our sponsors

Pester is sustained by the great folks on OpenCollective and GitHub Sponsors. Become a financial contributor and help us keep it thriving.

Individual backers

Individual backers

Organizations

Organization sponsors on OpenCollective

Ready to write your first test?

Install Pester and go from zero to a green test in minutes.