Invoke-ConsolePester
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] [-NoLiveView] [-Output <Diagnostic|Detailed|Normal|Minimal>] [-PassThru] [[-Path] <String[]>] [-TagFilter <String[]>] [-Title <String>] [<CommonParameters>]#SimpleInvoke-ConsolePester -Configuration <Object> [-ExportHtml <String>] [-FullScreen] [-NoLiveView] [-Title <String>] [<CommonParameters>]#AdvancedDescription
Runs Pester tests with a live ConsoleMonster dashboard and a summary table.
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. In redirected output, jobs and CI logs the output is one line per failure 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 -Path @('C:\Path')EXAMPLE 2
Invoke-ConsolePester -Configuration 'Value'Parameters
- -CI SwitchParameter
- CI mode as in Invoke-Pester: test results are written and the process exits with the failure count.
- -Container Object[]
- Containers from New-PesterContainer (Run.Container).
- -ExcludePath String[]
- Files or folders to leave out (Run.ExcludePath).
- -ExcludeTagFilter String[]
- Leave out tests with these tags (Filter.ExcludeTag).
- -ExportHtml String
- Saves the final dashboard as an HTML page.
- -FullNameFilter String[]
- Run only tests whose full name matches (Filter.FullName).
- -FullScreen SwitchParameter
- Shows the dashboard on the full screen (alternate screen) instead of inline.
- -NoLiveView SwitchParameter
- Runs Pester unchanged with its own output, followed by the summary table (no adapter).
- -Output String
- Pester's output verbosity (Output.Verbosity). None runs quietly: no dashboard and no summary.
- Possible values:
Diagnostic,Detailed,Normal,Minimal - -PassThru SwitchParameter
- Returns Pester's result object.
- -Path String[]
- Test files or folders (Run.Path); default the current folder.
- -TagFilter String[]
- Run only tests with these tags (Filter.Tag).
- -Title String
- The dashboard title (default Pester).
- -Configuration Object
- 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.