Skip to content
ConsoleMonster
Cmdlet

Invoke-ConsolePester

Module
ConsoleMonster
Outputs
System.Management.Automation.PSObject

Runs Pester tests with a live ConsoleMonster dashboard and a summary table.

Syntax

Invoke-ConsolePester
[-CI]
[-Container <Object[]>]
[-ExcludePath <String[]>]
[-ExcludeTagFilter <String[]>]
[-ExportHtml <String>]
[-FullNameFilter <String[]>]
[-FullScreen]
[-NoJobSummary]
[-NoLive]
[-Output <Diagnostic|Detailed|Normal|Minimal>]
[-PassThru]
[[-Path] <String[]>]
[-TagFilter <String[]>]
[-Title <String>]
[<CommonParameters>]
#
Parameter set: Simple
Invoke-ConsolePester
-Configuration <Object>
[-ExportHtml <String>]
[-FullScreen]
[-NoJobSummary]
[-NoLive]
[-Title <String>]
[<CommonParameters>]
#
Parameter set: Advanced

Description

In GitHub Actions, Azure Pipelines and GitLab CI, failures produce source-position annotations where supported, capped at ten per invocation with an overflow count. The results table and failures are added to the GitHub or Azure job summary unless NoJobSummary is set. GitLab has no annotation or job-summary API, so failures remain ordinary log lines. Native Pester result, throw and exit policies are applied after the summary.

Takes the parameters of Invoke-Pester (Path, ExcludePath, TagFilter, ExcludeTagFilter, FullNameFilter, Container, Output, CI, PassThru) or a -Configuration (a PesterConfiguration or a hashtable), and runs Pester 5 or 6, imported when first needed. While the tests run, an inline area (or the full screen with -FullScreen) shows the run totals and the clock, the test files as lanes with passed, failed and skipped counts, the running test, and with -FullScreen the failures (expected against actual, the file and line as a link), the slowest tests and a histogram of durations. When the run ends a table of results by file, the failures and the totals are written to the scrollback, and -ExportHtml saves the final dashboard and ends the summary with its path. In redirected output, jobs and CI logs the output is one line per failure, a progress line every 30 seconds (with the task progress in Azure Pipelines) and a summary line. Pester's result object is returned with -PassThru (or Run.PassThru), Run.Throw and Run.Exit (-CI) are applied after the summary, and Write-Host output from tests appears above the inline area. Pester has no public reporter API, so the live view uses Pester's internal plugin steps through a guarded adapter; when the internals are not what it expects (or with Run.Parallel or Output None) Pester runs unchanged with its own output and the summary table follows. Works on Windows PowerShell 5.1 and PowerShell 7.

Examples

Example 1

Invoke-ConsolePester -WhatIf

Preview running tests in the current folder

Example 2

$configuration = @{
    Run = @{ Path = './Tests'; PassThru = $true }
    Filter = @{ Tag = 'Unit' }
}
$pesterOptions = @{
    FullScreen = $true
    WhatIf = $true
    Configuration = $configuration
    ExportHtml = './pester.html'
}
Invoke-ConsolePester @pesterOptions

Preview running a configured suite and exporting its report

Parameters

-CI SwitchParameter optionalsets: Simple
CI mode as in Invoke-Pester: test results are written and the process exits with the failure count.
-Container Object[] optionalsets: Simple
Containers from New-PesterContainer (Run.Container).
-ExcludePath String[] optionalsets: Simple
Files or folders to leave out (Run.ExcludePath).
-ExcludeTagFilter String[] optionalsets: Simple
Leave out tests with these tags (Filter.ExcludeTag).
-ExportHtml String optional
Saves the final dashboard as an HTML page; the summary ends with its path, a link where the terminal supports links.
-FullNameFilter String[] optionalsets: Simple
Run only tests whose full name matches (Filter.FullName).
-FullScreen SwitchParameter optional
Shows the dashboard on the full screen (alternate screen) instead of inline.
-NoJobSummary SwitchParameter optional
Skips the automatic Markdown CI job summary. Failure annotations remain enabled, capped at ten per invocation.
-NoLive SwitchParameter optional
Runs Pester unchanged with its own output, followed by the summary table (no adapter).
-Output String optionalsets: Simple
Pester's output verbosity (Output.Verbosity). None runs quietly: no dashboard and no summary.
Possible values: Diagnostic, Detailed, Normal, Minimal
-PassThru SwitchParameter optionalsets: Simple
Returns Pester's result object.
-Path String[] optionalposition: 0sets: Simple
Test files or folders; omitted uses Pester's current-folder default.
-TagFilter String[] optionalsets: Simple
Run only tests with these tags (Filter.Tag).
-Title String optional
The dashboard title (default Pester).
-Configuration Object requiredsets: Advanced
A PesterConfiguration (New-PesterConfiguration) or a hashtable with the same sections.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.