Gets the session context.

Gets the current project directory and environment, which are used as context to a range of commands that might be executed as part of a deployment. The project directory contains naming standards and pipelines to deploy.

This command is part of the common command tooling.



Required. (SwitchParameter) Throws an exception if no Azure Context is set, prompting the user to sign in with Login-AzAccount or similar.


Required. (SwitchParameter) Throws an exception if the Cloudmarque Azure context is unset or empty, prompting the user to call the `Set-CmAzContext` command.


Example 1

$ctx = Get-CmAzContext -RequireAzure -ThrowIfUnavailable