# Invoke-MtTest

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

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

## SYNOPSIS

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

## SYNTAX

```powershell
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.&lt;ID&gt;.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

```powershell
Invoke-MtTest -Id MT.1005
```

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

### EXAMPLE 2

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

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

### EXAMPLE 3

```powershell
Invoke-MtTest -Path ./my-pack
```

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

## PARAMETERS

### -Id

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

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

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

### -Path

A Test.&lt;ID&gt;.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.

```yaml
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.

```yaml
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.

```yaml
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.

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

### System.Management.Automation.PSObject

## NOTES

## RELATED LINKS

[https://maester.dev/docs/commands/Invoke-MtTest](https://maester.dev/docs/commands/Invoke-MtTest)
