Skip to main content
Version: v5

Export-NUnitReport

SYNOPSIS#

Exports a Pester result-object to an NUnit-compatible XML-report

SYNTAX#

Export-NUnitReport [-Result] <Object> [-Path] <String> [<CommonParameters>]

DESCRIPTION#

Pester can generate a result-object containing information about all tests that are processed in a run. This object can then be exported to an NUnit-compatible XML-report using this function. The report is generated using the NUnit 2.5-schema.

This can be useful for further processing or publishing of test results, e.g. as part of a CI/CD pipeline.

EXAMPLES#

EXAMPLE 1#

$p = Invoke-Pester -Passthru
$p | Export-NUnitReport -Path TestResults.xml

This example runs Pester using the Passthru option to retrieve the result-object and exports it as an NUnit 2.5-compatible XML-report.

PARAMETERS#

-Result#

Result object from a Pester-run. This can be retrieved using Invoke-Pester -Passthru or by using the Run.PassThru configuration-option.

Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Path#

The path where the XML-report should to the ou the XML report as string.

Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters#

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS#

OUTPUTS#

NOTES#

RELATED LINKS#

https://pester.dev/docs/commands/Export-NUnitReport

https://pester.dev/docs/commands/Invoke-Pester

EDIT THIS PAGE#

This page was auto-generated using the comment based help in Pester 5.2.1. To edit the content of this page, change the corresponding help in the pester/Pester repository. See our contribution guide for more information.