MR
Mayur Rathi
@github
⭐ 0 GitHub stars

Pester-Migration

Pester-Migration is an data AI skill with a core value of Experimental (preview) Pester migration skill for upgrading PowerShell Pester test suites across major versions — v3→v4, v4→v5, and v5→v6. It helps developers solve real-world problems in the data domain, boosting efficiency, automating repetitive tasks, and optimizing workflows.

Experimental (preview) Pester migration skill for upgrading PowerShell Pester test suites across major versions — v3→v4, v4→v5, and v5→v6. The v5→v6 path tracks Pester 6, which is still a release cand

Last verified on: 2026-07-05

Quick Facts

Category data
Works With Claude, GitHub Copilot
Source github/awesome-copilot
Last Verified 2026-07-05
Risk Level Medium
mkdir -p ./skills/pester-migration && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/pester-migration/SKILL.md -o ./skills/pester-migration/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# Pester Migration


> **Experimental / preview.** The **v5→v6** guidance tracks Pester 6 while it is a release

> candidate and may change; verify against the current

> [release notes](https://github.com/pester/Pester/releases). v3→v4 and v4→v5 cover stable releases.


Pester is the test framework for PowerShell. Test files end in `*.Tests.ps1` and use

`Describe` / `Context` / `It` blocks with `Should` assertions. This skill upgrades an existing

suite from one major Pester version to the next and gets it green again.


> **Mental model:** each major jump has a different character. **v3→v4** is mostly a syntax

> rename. **v4→v5** is a *fundamental runtime change* (the Discovery/Run split) and is the hard

> one. **v5→v6** is largely backwards-compatible — a handful of previously-deprecated things now

> throw. Migrate **one major at a time**; never skip a version.


Detailed, symptom-driven guides live in `references/` — load the one(s) for the jump you are doing.


References


| Reference | When to load |

|---|---|

| [v3-to-v4.md](references/v3-to-v4.md) | `Should Be` → `Should -Be`, `Contain` → `FileContentMatch`, `Assert-VerifiableMocks` → `Assert-VerifiableMock`, array-assertion edge cases. |

| [v4-to-v5.md](references/v4-to-v5.md) | The big one. Discovery/Run phases, `BeforeAll` setup, `$PSScriptRoot`, `BeforeDiscovery`, `-ForEach`, mock scoping, `Should -Throw` wildcards, `Invoke-Pester` → `New-PesterConfiguration`. |

| [v5-to-v6.md](references/v5-to-v6.md) | PowerShell 5.1/7.4+ only, per-file discovery+run, empty `-ForEach` throws, duplicate setup blocks throw, name `<...>` templates evaluate, `Assert-MockCalled` removed, mocks no longer fall through, code-coverage tracer, legacy `Invoke-Pester` params removed. |


Canonical source: the official migration guides at https://pester.dev/docs/migrations/ — this skill

mirrors them. When in doubt, prefer the website.


Step 0 — Detect where you are and where you're going


Find the installed version(s) and the version the **tests** were written for. These can differ.


powershell
# Installed Pester version(s) on this machine
Get-Module Pester -ListAvailable | Select-Object Name, Version, Path

# Version currently imported in the session
(Get-Module Pester).Version

Tell the source version from the **test code** with these heuristics:


| You see in `*.Tests.ps1` / build scripts | Suite was written for |

|---|---|

| `Should Be` / `Should Contain` (no dash) | v3 or earlier → start at [v3-to-v4](references/v3-to-v4.md) |

| `$MyInvocation.MyCommand.Path` + dot-source at the **top** of the file; arbitrary code directly under `Describe` | v4 → [v4-to-v5](references/v4-to-v5.md) |

| `Assert-MockCalled`, `Assert-VerifiableMock`, `Set-ItResult -Pending` | v4 / early-v5 (these are **removed in v6**) |

| `Invoke-Pester -Script … -OutputFile … -CodeCoverage …` (legacy params) | v4 invocation → map to config |

| `BeforeAll { . $PSScriptRoot/… }`, `New-PesterConfiguration`, `Should -Invoke` | already v5-style → [v5-to-v6](references/v5-to-v6.md) |


Install the target version when ready:


powershell
# Latest stable v5 — pin the major so this keeps installing v5 even after v6 goes GA
Install-Module Pester -MaximumVersion 5.99.99 -Force

# Pester 6 (currently a release candidate — needs -AllowPrerelease)
Install-Module Pester -AllowPrerelease -Force

> On **Windows PowerShell 5.1** the OS ships a Microsoft-signed built-in Pester 3 that PowerShellGet

> won't overwrite with the differently-signed newer Pester — add `-SkipPublisherCheck` there to

> install side-by-side. Not needed on PowerShell 7+. See

> https://pester.dev/docs/introduction/installation.


Migration workflow


Run this loop for each major jump. **Do not jump two majors at once** — go v4→v5, then v5→v6.


1. **Baseline.** Run the suite on the **current** version first and record pass/fail. You need a

known-good (or known) starting point so you can tell migration regressions apart from

pre-existing failures.

```pow

🎯 Best For

  • Engineering teams doing code reviews
  • Open source maintainers
  • QA engineers
  • Developers writing unit tests
  • UI designers

💡 Use Cases

  • Reviewing pull requests for security vulnerabilities
  • Checking code style consistency
  • Generating test cases for edge conditions
  • Writing integration test suites

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Pester-Migration to Your Work

    Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.

  4. 4

    Review and Refine

    Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.

❓ Frequently Asked Questions

Does this skill check for OWASP Top 10?

Security-focused review skills often include OWASP checks. Check the skill content for specific vulnerability categories covered.

Does this generate test mocks?

Many testing skills include mock generation. Check the install command and skill content for details.

Does this work with Figma?

Some design skills integrate with Figma plugins. Check the Works With section for supported tools.

How do I install Pester-Migration?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/pester-migration/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Blindly accepting AI suggestions

Always verify AI-generated review comments. Some suggestions may not apply to your specific codebase conventions.

Not testing edge cases

AI tends to generate happy-path tests. Manually review for boundary conditions.

Skipping usability testing

AI-generated designs should be validated with real users before development.

Ignoring data quality

AI analysis inherits all data quality issues — profile your data first.

🔗 Related Skills