Get-AtriaApiContext
SYNOPSIS
Gets the current context of the Atria API connection.
SYNTAX
Get-AtriaApiContext [<CommonParameters>]
DESCRIPTION
Returns a hashtable containing the authentication token, API base URI, connected user, roles, and connection status.
The connection status (connected) indicates whether the session has an active authentication token.
PARAMETERS
<CommonParameters>
This cmdlet supports common parameters:
Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
For more information, see about_CommonParameters.
OUTPUTS
A hashtable with the following keys:
| Name | Type | Description |
|---|---|---|
apiAuthToken | String | Current bearer token. Treat this value as a secret. |
apiBaseUri | String | Base URL of the Atria API. |
UserName | String | Account name returned by token validation. |
UserLabel | String | Display label returned by token validation. |
Roles | Collection | Atria roles returned by token validation. |
connected | Boolean | Whether a token is currently stored in the module session. |
EXAMPLES
Example 1
$context = Get-AtriaApiContext
[pscustomobject]@{
Connected = $context.connected
ApiBase = $context.apiBaseUri
UserName = $context.UserName
UserLabel = $context.UserLabel
Roles = $context.Roles -join ', '
}
Displays a safe summary without printing the apiAuthToken entry.
NOTES
The returned hashtable contains the live bearer token. Select only the non-secret fields needed for diagnostics; do not print, serialize, export, or log the complete context.