Skip to content
3.0 preview2.3.0 stable

These docs describe the preview. Pick the version you run and every page marks what it doesn't have yet. Get the preview →
Maester 2.x docs (archived) →

Sponsor

Get-MtHtmlReport

Generates a formatted html report using the MaesterResults object created by ConvertTo-MtMaesterResult

Get-MtHtmlReport [-MaesterResults] <PSObject> [-RedactUserIdentity <String>]
[-UserIdentityReplacementMap <Hashtable>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

The generated html is a single file that provides a visual representation of the test results with a summary view and click through of the details.

Supports both single-tenant results (from ConvertTo-MtMaesterResult) and multi-tenant results (from Merge-MtMaesterResult).

The report omits each test’s ErrorRecord, which the report doesn’t display. The MaesterResults object passed in and the JSON results file keep it.

$pesterResults = Invoke-Pester -PassThru
$maesterResults = ConvertTo-MtMaesterResult $pesterResults
$output = Get-MtHtmlReport -MaesterResults $maesterResults
$output | Out-File -FilePath $out.OutputHtmlFile -Encoding UTF8

This example shows how to generate the html report and save it to a file by using Invoke-Pester

$maesterResults = Invoke-Maester -PassThru
$output = Get-MtHtmlReport -MaesterResults $maesterResults
$output | Out-File -FilePath $out.OutputHtmlFile -Encoding UTF8

This example shows how to generate the html report and save it to a file by using Invoke-Maester

$result1 = Invoke-Maester -PassThru
$result2 = Invoke-Maester -PassThru
$merged = Merge-MtMaesterResult -MaesterResults @($result1, $result2)
$output = Get-MtHtmlReport -MaesterResults $merged
$output | Out-File -FilePath "MultiTenantReport.html" -Encoding UTF8

This example shows how to generate a multi-tenant html report

The Maester test results returned from Invoke-Pester -PassThru | ConvertTo-MtMaesterResult or from Merge-MtMaesterResult for multi-tenant reports.

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

Replaces user identities (display names, user principal names and object ids) with stable stable ids. None: keep the values as-is. HtmlOnly / AllOutputs: redact them from this html report.

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

Replacement map built by Invoke-Maester, which removes the AffectedObjects it was built from.

Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

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

https://maester.dev/docs/commands/Get-MtHtmlReport