- PowerShell 7.4+ (setup-powershell-windows.md)
Windows ships with Pester 3.4 as an inbox module. This version is incompatible with the
Continuous Delphi test suite, which requires Pester 5. Both versions can coexist on the
same machine (installing Pester 5 does not remove 3.4.)
The inbox Pester 3.4 is signed by Microsoft. Installing a newer version from the PowerShell
Gallery requires bypassing the publisher check with -SkipPublisherCheck.
Open a pwsh terminal (PowerShell 7, not Windows PowerShell) and run:
Install-Module -Name Pester -MinimumVersion 5.7.0 -Force -SkipPublisherCheck -Scope CurrentUserFlag explanations:
| Flag | Reason |
|---|---|
-MinimumVersion 5.7.0 |
Ensures Pester 5 is installed, not an older version |
-Force |
Allows installation even when another version is already present |
-SkipPublisherCheck |
Required because inbox Pester 3.4 is Microsoft-signed; this allows a different publisher |
-Scope CurrentUser |
Installs for your user account only; does not require administrator elevation |
After installation, confirm both versions are present:
Get-Module -ListAvailable Pester | Select-Object Name, Version, PathExpected output will show two entries: version 3.4.0 (inbox) and version 5.7.x (newly installed).
Confirm Pester 5 loads correctly:
Import-Module Pester -MinimumVersion 5.7.0 -Force
(Get-Module Pester).VersionExpected output: 5.7.x or higher.
Because PowerShell may default to loading Pester 3.4, always import Pester 5 explicitly before running tests:
Import-Module Pester -MinimumVersion 5.7.0 -Force
Invoke-Pester ./tests/pwsh -Output Detailed- The
-Forceflag inImport-Moduleoverrides the automatically loaded 3.4 version. Without it,Invoke-Pestermay use Pester 3 syntax and fail with ambiguous parameter errors. - If you see
Parameter cannot be processed because the parameter name 'Output' is ambiguous, Pester 3 is loaded. Run theImport-Modulecommand above to switch to Pester 5. - CI pipelines pin Pester to a specific patch version using
-RequiredVersionfor reproducibility. Local development uses-MinimumVersionfor flexibility.