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

Invoke-MtTest

Runs one or more Maester native tests through the engine and returns their result rows.

Invoke-MtTest [[-Id] <String[]>] [-Path <String>] [-Parameter <Hashtable>] [-Config <Object>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]

Runs built-in tests by ID, or the native tests (Test.<ID>.ps1) in a file or folder, with the same applicability gates, parameter binding and result rows as Invoke-Maester, but without reports.

This is how a custom test reuses a built-in check (instead of calling its function directly), and how a test author runs the test they are writing.

Invoke-MtTest -Id MT.1005

Runs the built-in test MT.1005 and returns its result row.

Invoke-MtTest -Path ./custom/Test.CONTOSO.1001.ps1 -Parameter @{ MaximumDays = 30 }

Runs a custom test with a parameter value, as while writing it.

Invoke-MtTest -Path ./my-pack

Runs every test of a Maester Pack from its folder, as while writing the pack.

Test IDs to run: exact IDs or ’*’ wildcards. A family’s instance ID runs that instance.

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

A Test.<ID>.ps1 file or a folder of them. Without -Id every native test in it runs. A path inside a Maester Pack (a folder with maester-pack.json, or under one) runs as that pack, with its helpers and connectors, as while writing the pack.

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

Parameter values for the test. Allowed only when exactly one test is selected.

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

The run configuration: a path, an object or an array of them, as for Invoke-Maester. Defaults to the configuration of the current Invoke-Maester run, else the config files found from -Path or the current folder.

Type: Object
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/Invoke-MtTest