- PowerShell 7.4+ (setup-powershell-windows.md)
- Pester 5.7+ (setup-pester-windows.md)
If you prefer to run the verification as a single script rather than follow the manual steps below:
Invoke-Expression (Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/continuous-delphi/cd-doc-dev-setup/main/tools/Invoke-PesterSmokeTest.ps1').ContentOr if you have already cloned this repository:
pwsh ./tools/Invoke-PesterSmokeTest.ps1The manual steps below cover exactly what the script does. Follow them if you prefer to work through each check individually, or if the shortcut itself fails.
These smoke tests confirm that PowerShell 7 and Pester 5 are correctly installed, that the right versions are active, and that Pester can discover and run a test. Run these after completing the installation tasks and before attempting to run any Continuous Delphi test suite.
Open a terminal and run:
pwsh --versionExpected: PowerShell 7.4.0 or higher.
If pwsh is not found or returns a 5.x version, complete
setup-powershell-windows.md first.
Inside a pwsh session, run:
$PSVersionTable.PSVersionExpected output shows Major as 7 and Minor as 4 or higher:
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 5 4
Get-Module -ListAvailable Pester | Select-Object Name, VersionExpected: at least one entry with version 5.7.x or higher.
Import-Module Pester -MinimumVersion 5.7.0 -Force
(Get-Module Pester).VersionExpected: 5.7.x or higher. If this returns 3.4.0, the -Force flag did not override
the inbox version. Try closing and reopening your terminal, then repeat the import.
Invoke-Pester -Configuration (New-PesterConfiguration | ForEach-Object {
$_.Run.ScriptBlock = { Describe 'Smoke' { It '1 + 1 equals 2' { (1+1) | Should -Be 2 } } }
$_.Output.Verbosity = 'Detailed'
$_
})Expected output:
Pester v5.7.x
Starting discovery in 1 files.
Discovery found 1 tests in Xms.
Running tests.
Describing Smoke
[+] 1 + 1 equals 2 Xms
Tests completed in Xms
Tests Passed: 1, Failed: 0, Skipped: 0, Inconclusive: 0, NotRun: 0
A passing result confirms PowerShell 7 and Pester 5 are correctly installed and functional.
| Symptom | Likely cause | Fix |
|---|---|---|
pwsh not found |
PowerShell 7 not installed or not in PATH | Complete setup-powershell-windows.md, open a new terminal |
Output parameter ambiguous error |
Pester 3 is loaded | Run Import-Module Pester -MinimumVersion 5.7.0 -Force |
| Pester version shows 3.4.0 after import | -Force not used |
Add -Force to the Import-Module command |
| Test file not found during Invoke-Pester | Wrong working directory | Confirm the path passed to -Path is correct |