Skip to main content

Get-ZrConnection

Reports the current session's Zaris store connection state — whether a store is connected and, if so, its name, endpoints, and the time the connection was established.

Syntax

Get-ZrConnection

Description

Get-ZrConnection reads the ambient connection context set by Connect-ZrStore. It takes no parameters and performs no network I/O, so it is safe to call at any time — useful for verifying connection status, debugging, and scripting connection checks.

When a store is connected it returns IsConnected = true with the store name, endpoints, and connection timestamp. When nothing is connected it still returns a valid object with IsConnected = false.

The returned object has IsConnected, StoreName, Endpoints, ClientId, ConnectedAtUtc, Success, and Error. Note that ClientId is always null — no live client is retained in the context.

Parameters

This cmdlet has no parameters (beyond the PowerShell common parameters).

Examples

Show whether a store is connected and, if so, its name and endpoints:

Get-ZrConnection

Branch on connection state in a script:

if ((Get-ZrConnection).IsConnected) {
Write-Host "Connected to Zaris store"
}