# Get-MtHtmlReport

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

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

## SYNOPSIS

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

## SYNTAX

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

## 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.

The results are embedded gzip-compressed and Base64-encoded, which keeps the file small.
Scripts that
read the results should read the JSON results file rather than the HTML.

Reports added with Add-MtReportAttachment are embedded in the page, each in its own element, and
opened from a button.
They are left out when RedactUserIdentity is HtmlOnly or AllOutputs, because
Maester cannot redact another tool's report.
JSON attachments, data that a built-in view of the report
reads, are kept and redacted the way the results are.

## EXAMPLES

### EXAMPLE 1

```powershell
$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

### EXAMPLE 2

```powershell
$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

### EXAMPLE 3

```powershell
$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

## PARAMETERS

### -MaesterResults

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

```yaml
Type: PSObject
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -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.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -UserIdentityReplacementMap

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

```yaml
Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ProgressAction

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

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
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](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS

[https://maester.dev/docs/commands/Get-MtHtmlReport](https://maester.dev/docs/commands/Get-MtHtmlReport)
