Get-MtConnectionState
Synopsis
Section titled “Synopsis”Returns what a Maester Pack connector kept with Set-MtConnectionState, or nothing when it is not connected.
Syntax
Section titled “Syntax”Get-MtConnectionState [[-Service] <String>] [-Detailed] [-ProgressAction <ActionPreference>] [<CommonParameters>]Description
Section titled “Description”A pack’s tests and helpers call this to reach the service their connector connected to (Maester Packs design, section 6.1). Inside a pack, it returns the state of the pack’s own connector, or of a pack it requires; one pack cannot read another pack’s connection. Called from outside a pack, -Service is required.
By default the value the connector kept is returned. -Detailed returns Service, Value, Account, Tenant and ConnectedAt.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”$token = (Get-MtConnectionState).TokenInside a pack test: the token the pack’s connector kept.
Example 2
Section titled “Example 2”Get-MtConnectionState -Service CNT.GoogleWorkspace -DetailedAt the console: who is connected to the service of an installed pack.
Parameters
Section titled “Parameters”-Service
Section titled “-Service”The connector’s service name, such as CNT.GoogleWorkspace. Needed only when the pack has more than one connector, or outside a pack.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 1Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Detailed
Section titled “-Detailed”Return the whole record: Service, Value, Account, Tenant and ConnectedAt.
Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept 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.