Get-MtTenantContext
Synopsis
Section titled “Synopsis”Returns the facts about the connected tenant that decide which Maester tests apply.
Syntax
Section titled “Syntax”Get-MtTenantContext [[-Service] <String[]>] [[-Environment] <Object>] [-ProgressAction <ActionPreference>] [<CommonParameters>]Description
Section titled “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
Section titled “Examples”Example 1
Section titled “Example 1”Get-MtTenantContextShows the tenant type, cloud, connected services and licence state of the current connection.
Parameters
Section titled “Parameters”-Service
Section titled “-Service”The services to check the connection of. Defaults to every service in the service registry.
Type: String[]Parameter Sets: (All)Aliases:
Required: FalsePosition: 1Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Environment
Section titled “-Environment”The Environment section of a Maester config, whose values replace detected ones.
Type: ObjectParameter Sets: (All)Aliases:
Required: FalsePosition: 2Default value: NoneAccept pipeline input: FalseAccept 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.