Skip to main content
Version: v5

ConvertTo-Pester4Result

This page was generated

Contributions are welcome in Pester-repo.

SYNOPSIS​

Converts a Pester 5 result-object to an Pester 4-compatible object

SYNTAX​

ConvertTo-Pester4Result [-PesterResult] <Object> [<CommonParameters>]

DESCRIPTION​

Pester 5 uses a new format for it's result-object compared to previous versions of Pester. This function is provided as a way to convert the result-object into an object using the previous format. This can be useful as a temporary measure to easier migrate to Pester 5 without having to redesign complex CI/CD-pipelines.

EXAMPLES​

EXAMPLE 1​

$pester5Result = Invoke-Pester -Passthru
$pester4Result = $pester5Result | ConvertTo-Pester4Result

This example runs Pester using the Passthru option to retrieve a result-object in the Pester 5 format and converts it to a new Pester 4-compatible result-object.

PARAMETERS​

-PesterResult​

Result object from a Pester 5-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

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​

https://pester.dev/docs/commands/ConvertTo-Pester4Result

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

VERSION​

This page was generated using comment-based help in Pester 5.6.1.