Skip to main content
Version: 2.0.1 (preview)

Import-MtMaesterResult

SYNOPSISโ€‹

Imports Maester test result JSON files from disk into PowerShell objects.

SYNTAXโ€‹

Import-MtMaesterResult [-Path] <String[]> [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTIONโ€‹

Loads one or more Maester test result JSON files and returns them as an array of single-tenant MaesterResults objects. This is the standard way to load previously saved results for use with Merge-MtMaesterResult, Compare-MtTestResult, or any future command that operates on result objects.

If a loaded JSON file contains a multi-tenant merged format (i.e. a "Tenants" array from a prior Merge-MtMaesterResult call), each tenant is automatically expanded into a separate result object.

Accepts file paths, glob patterns, or directory paths. When a directory is provided, it auto-discovers TestResults-*.json files inside it.

EXAMPLESโ€‹

EXAMPLE 1โ€‹

# Load a single result file
Import-MtMaesterResult -Path ./production.json

EXAMPLE 2โ€‹

# Load all JSON files matching a glob
Import-MtMaesterResult -Path ./results/*.json

EXAMPLE 3โ€‹

# Load from a directory (auto-discovers TestResults-*.json)
Import-MtMaesterResult -Path ./test-results/

EXAMPLE 4โ€‹

# Pipe into Merge for a multi-tenant report
Import-MtMaesterResult -Path *.json | Merge-MtMaesterResult | Get-MtHtmlReport | Out-File report.html

PARAMETERSโ€‹

-Pathโ€‹

One or more paths to JSON result files, glob patterns, or directories.

  • File path: ./production.json
  • Glob: ./results/*.json
  • Directory: ./results/ (discovers TestResults-*.json inside)
Type: String[]
Parameter Sets: (All)
Aliases: FullName

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

-ProgressActionโ€‹

{{ Fill ProgressAction Description }}

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.

INPUTSโ€‹

OUTPUTSโ€‹

System.Object[]โ€‹

NOTESโ€‹

https://maester.dev/docs/commands/Import-MtMaesterResult