Skip to main content
Version: 3.0.0-preview

Invoke-MtTest

SYNOPSIS​

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

SYNTAX​

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

DESCRIPTION​

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.

EXAMPLES​

EXAMPLE 1​

Invoke-MtTest -Id MT.1005

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

EXAMPLE 2​

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

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

PARAMETERS​

-Id​

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

-Path​

A Test.<ID>.ps1 file or a folder of them. Without -Id every native test in it runs.

Type: String
Parameter Sets: (All)
Aliases:

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

-Parameter​

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

-Config​

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

-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: 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.Management.Automation.PSObject​

NOTES​

https://maester.dev/docs/commands/Invoke-MtTest