Import-MtMaesterResult
SYNOPSIS
Section titled “SYNOPSIS”Imports Maester test result JSON files from disk into PowerShell objects.
SYNTAX
Section titled “SYNTAX”Import-MtMaesterResult [-Path] <String[]> [-ProgressAction <ActionPreference>] [<CommonParameters>]DESCRIPTION
Section titled “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
Section titled “EXAMPLES”EXAMPLE 1
Section titled “EXAMPLE 1”# Load a single result fileImport-MtMaesterResult -Path ./production.jsonEXAMPLE 2
Section titled “EXAMPLE 2”# Load all JSON files matching a globImport-MtMaesterResult -Path ./results/*.jsonEXAMPLE 3
Section titled “EXAMPLE 3”# Load from a directory (auto-discovers TestResults-*.json)Import-MtMaesterResult -Path ./test-results/EXAMPLE 4
Section titled “EXAMPLE 4”# Pipe into Merge for a multi-tenant reportImport-MtMaesterResult -Path *.json | Merge-MtMaesterResult | Get-MtHtmlReport | Out-File report.htmlPARAMETERS
Section titled “PARAMETERS”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: TruePosition: 1Default value: NoneAccept pipeline input: True (ByPropertyName, ByValue)Accept 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.