Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

Stars 48
Forks 16
PowerShell Gallery downloads 17,213
Release v3.0.169
Language: C# Updated: 2026-10-17
Command

Get-ModuleTestFailures

Module PSPublishModule
Inputs
System.Object

Analyzes and summarizes failed Pester tests from either a Pester results object or an NUnit XML result file.

Syntax

Get-ModuleTestFailures [-OutputFormat <Summary|Detailed|Json>] [-PassThru] [-Path <String>] [-ProjectPath <String>] [-ShowSuccessful] [<CommonParameters>]
#
Parameter set: Path
Get-ModuleTestFailures [-OutputFormat <Summary|Detailed|Json>] [-PassThru] [-ProjectPath <String>] [-ShowSuccessful] -TestResults <Object> [<CommonParameters>]
#
Parameter set: TestResults

Description

This cmdlet is designed to make CI output and local troubleshooting easier by summarizing failures from:

Use -OutputFormat to control whether the cmdlet writes a concise host summary, detailed messages, or emits JSON to the pipeline.

Examples

Authored help example

Analyze test failures from the default results location

Get-ModuleTestFailures

Searches for TestResults.xml under the project and prints a detailed failure report.

Analyze failures from a specific NUnit XML file

Get-ModuleTestFailures -Path 'Tests\TestResults.xml' -OutputFormat Summary

Writes a compact summary that is suitable for CI logs.

Pipe results from Invoke-ModuleTestSuite

Invoke-ModuleTestSuite -ProjectPath 'C:\Git\MyModule' | Get-ModuleTestFailures -OutputFormat Detailed -PassThru

Uses the in-memory results and returns the analysis object for further processing.

Parameters

-OutputFormat ModuleTestFailureOutputFormat optional
Format for displaying test failures.
Possible values: Summary, Detailed, Json
-PassThru SwitchParameter optional
Return the failure analysis object for further processing.
-Path String optionalsets: Path
Path to the NUnit XML test results file. If not specified, searches for TestResults.xml under ProjectPath.
-ProjectPath String optional
Path to the project directory used to locate test results when Path is not specified.
-ShowSuccessful SwitchParameter optional
Include successful tests in the output (only applies to Summary format).
-TestResults Object requiredpipeline: True (ByValue)sets: TestResults
Pester test results object from Invoke-Pester, a ModuleTestSuiteResult from Invoke-ModuleTestSuite, or a precomputed ModuleTestFailureAnalysis.

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.