# Get-MtTenantContext

Returns the facts about the connected tenant that decide which Maester tests apply.

Source: https://maester.dev/docs/commands/Get-MtTenantContext

## SYNOPSIS

Returns the facts about the connected tenant that decide which Maester tests apply.

## SYNTAX

```powershell
Get-MtTenantContext [[-Service] <String[]>] [[-Environment] <Object>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]
```

## DESCRIPTION

The tenant context holds the tenant ID and name, tenant type (Workforce or External), cloud, the
operating system Maester runs on, which services are connected, and the tenant's licences (service
plan names, service plan IDs and SKU IDs).
Invoke-Maester builds it once per run, records it in the
results as TenantContext, and uses it to decide whether each test applies.

Each fact comes from its own provider.
A value set under Environment in the Maester config replaces
the detected value: TenantType, Cloud, Licenses (a list of service plan names) and Services (a map
of service name to true or false).
A fact that cannot be detected is Unknown and never makes a test
skip.

## EXAMPLES

### EXAMPLE 1

```powershell
Get-MtTenantContext
```

Shows the tenant type, cloud, connected services and licence state of the current connection.

## PARAMETERS

### -Service

The services to check the connection of.
Defaults to every service in the service registry.

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

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

### -Environment

The Environment section of a Maester config, whose values replace detected ones.

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
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/Get-MtTenantContext](https://maester.dev/docs/commands/Get-MtTenantContext)
