Skip to content
Breakpoint logobreakpoınt

PSKoans

Make failing Pester tests pass to learn PowerShell scripting step by step

Run Show-Karma and the module names the next assertion that fails and the file it lives in. Show-Karma -Contemplate opens the koan folder in your editor, and the opening file, AboutAssertions, asks you to replace blanks such as $____ and __ so that lines like __ + 5 | Should -Be 10 hold true. Save, run Show-Karma again, and the next one is waiting.

Play on github.com

Free · No login · Terminal · Beginner

Screenshot of PSKoans

About PSKoans

The library is split into topic files across folders. Introduction covers assertions, booleans, numbers, strings, binary, Get-Member and cmdlet verbs. Foundations moves through arrays, hashtables, comparison, conditionals, loops and pipelines, and functions and script blocks. Two Cmdlets folders deal with Where-Object, Group-Object, Compare-Object and the CSV and Out cmdlets, and Constructs and Patterns reaches classes, enums, splatting, error handling, regular expressions, XML and StringBuilder. Two katas ask you to process strings and sort characters, and further folders exercise dbatools against mocked SQL Server results and Active Directory filtering.

Rain (vexx32 on GitHub) created the project, which now lives under PowerShellOrg. The format is the one Rustlings uses for Rust. UnderTheWire also runs on PowerShell, but as an SSH wargame where you hunt for passwords.

Questions about PSKoans

What do I need installed before the PowerShell koans will run?

PowerShell 5.1 or later with Pester 5, and on a fresh Windows setup the NuGet package provider too.

How does a koan check whether my answer is right?

Each koan is a failing Pester test, and it turns green when you fill in the right value or write the missing code.

Made this game? Claim it →

Keyboard shortcuts

j / k
Move down / up the list (this page)
] / [
Next / previous page
o
Open the focused game
b
Save or unsave the focused game
/
Search (the home list, or the command palette elsewhere)
Ctrl K
Command palette: games, skills, pages (works even when single keys are off)
?
This help