Get-MtHtmlReport
SYNOPSIS
Section titled “SYNOPSIS”Generates a formatted html report using the MaesterResults object created by ConvertTo-MtMaesterResult
SYNTAX
Section titled “SYNTAX”Get-MtHtmlReport [-MaesterResults] <PSObject> [-RedactUserIdentity <String>] [-UserIdentityReplacementMap <Hashtable>] [-ProgressAction <ActionPreference>] [<CommonParameters>]DESCRIPTION
Section titled “DESCRIPTION”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.
EXAMPLES
Section titled “EXAMPLES”EXAMPLE 1
Section titled “EXAMPLE 1”$pesterResults = Invoke-Pester -PassThru$maesterResults = ConvertTo-MtMaesterResult $pesterResults$output = Get-MtHtmlReport -MaesterResults $maesterResults$output | Out-File -FilePath $out.OutputHtmlFile -Encoding UTF8This example shows how to generate the html report and save it to a file by using Invoke-Pester
EXAMPLE 2
Section titled “EXAMPLE 2”$maesterResults = Invoke-Maester -PassThru$output = Get-MtHtmlReport -MaesterResults $maesterResults$output | Out-File -FilePath $out.OutputHtmlFile -Encoding UTF8This example shows how to generate the html report and save it to a file by using Invoke-Maester
EXAMPLE 3
Section titled “EXAMPLE 3”$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 UTF8This example shows how to generate a multi-tenant html report
PARAMETERS
Section titled “PARAMETERS”-MaesterResults
Section titled “-MaesterResults”The Maester test results returned from Invoke-Pester -PassThru | ConvertTo-MtMaesterResult
or from Merge-MtMaesterResult for multi-tenant reports.
Type: PSObjectParameter Sets: (All)Aliases:
Required: TruePosition: 1Default value: NoneAccept pipeline input: True (ByValue)Accept wildcard characters: False-RedactUserIdentity
Section titled “-RedactUserIdentity”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: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-UserIdentityReplacementMap
Section titled “-UserIdentityReplacementMap”Replacement map built by Invoke-Maester, which removes the AffectedObjects it was built from.
Type: HashtableParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-ProgressAction
Section titled “-ProgressAction”Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
Section titled “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.