# Get-ModuleTestFailures

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

Project

PSPublishModule

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

[View on GitHub](https://github.com/EvotecIT/PSPublishModule) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSPublishModule/releases/tag/v3.0.124) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSPublishModule/2.0.27)

Stars **48**

Forks **15**

Open issues **1**

PowerShell Gallery downloads **17,213**

Release **v3.0.195**

Language: C# Updated: 2026-11-25

Command 

**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>]
```

[#](#method-get-moduletestfailures-moduletestfailureoutputformat-switchparameter-string-string-switchparameter)

Parameter set: `Path`

```
Get-ModuleTestFailures
[-OutputFormat <Summary|Detailed|Json>]
[-PassThru]
[-ProjectPath <String>]
[-ShowSuccessful]
-TestResults <Object>
[<CommonParameters>]
```

[#](#method-get-moduletestfailures-moduletestfailureoutputformat-switchparameter-string-switchparameter-object)

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

### Analyze test failures from the default results location

```powershell
Get-ModuleTestFailures
```

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

### Analyze failures from a specific NUnit XML file

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

Writes a compact summary that is suitable for CI logs.

### Pipe results from Invoke-ModuleTestSuite

```powershell
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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:B27B5631EF6FB920431ACD6D8EDE31C2C14545D6611EA2032971952FAB3D3996 -->
