Skip to main content

SYNOPSIS

Throws a clear error when there is no active Exchange Online session.

SYNTAX

Assert-PS365ExchangeOnlineConnection [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Exchange Online cmdlets (Get-AcceptedDomain, Get-Mailbox, …) emit a cryptic “term not recognized” error when called without a session. This helper checks for an active connection up front and tells the caller to run Connect-ExchangeOnline first, mirroring the Graph connection check used elsewhere in the module.

EXAMPLES

PARAMETERS

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

NOTES