Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides PowerShell Pester test suites through major upgrades (v3→v4, v4→v5, v5→v6), covering Discovery/Run changes, mocks and configuration.
73% 95%+23 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 16 of 22 without it.
3 of 3 safety checks passed
16 agent runs
This is the smallest jump — mostly an assertion-syntax rename. Many suites need only minor changes, some need none. It is largely script-automatable, but always review the diff and re-run the suite.
Official guide: https://pester.dev/docs/migrations/v3-to-v4
Heads-up: if your goal is a modern Pester (5 or 6), v3→v4 is only the first step. Do it, get green, then continue with v4-to-v5.md and v5-to-v6.md.
Should assertion syntaxv4 introduced the parameter-style Should syntax. The bareword form still ran in v4 but is
removed in v5, so converting now saves a later migration.
# v3 (bareword)
It 'checks something' { 10 | Should Be 10 }
# v4+ (dashed)
It 'checks something' { 10 | Should -Be 10 }
The rename applies to every operator: Be, BeExactly, Match, Throw, BeNullOrEmpty,
Contain, etc. → -Be, -BeExactly, -Match, -Throw, -BeNullOrEmpty, …
There is a well-known AST-based converter, Update-PesterTest (Chris Dent / Wojciech Sciesinski),
that inserts the dashes safely by parsing the file rather than regexing it:
https://gist.github.com/indented-automation/aeb14825e39dd8849beee44f681fbab3 — it's also reproduced
in the official v3→v4 guide. Review its output, especially for non-UTF-8/ASCII files, where it can
change encoding.
Contain → FileContentMatchThe Contain assertion was renamed to FileContentMatch (it tests file contents, which the
old name made ambiguous against collection containment).
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.