Private/Show-PDConnectionBanner.ps1

function Show-PDConnectionBanner {
    <#
    .SYNOPSIS
        Writes the PowerDMARC connection banner (internal helper, mirrors Connect-ExchangeOnline /
        Connect-MgGraph style connection banners).
    #>

    [CmdletBinding()]
    param(
        [Parameter(Mandatory)]
        [pscustomobject]$Connection
    )

    $line = '-' * 62

    Write-Host ''
    Write-Host $line -ForegroundColor Cyan
    Write-Host ' PowerDMARC PowerShell Module' -ForegroundColor Cyan
    Write-Host $line -ForegroundColor Cyan
    Write-Host " Mode : $($Connection.Mode)"
    Write-Host " Base URI : $($Connection.BaseUri)"
    Write-Host " Connected : $($Connection.ConnectedAt.ToString('yyyy-MM-dd HH:mm:ss'))"

    if ($Connection.Mode -eq 'Reseller') {
        if ($Connection.AccountId) {
            Write-Host " AccountId : $($Connection.AccountId)"
        } else {
            Write-Host ''
            Write-Host ' Reseller mode: no default customer account is set yet.' -ForegroundColor Yellow
            Write-Host ' Run Get-PDAccount to list customer accounts, then Select-PDAccount -AccountId <id>' -ForegroundColor Yellow
            Write-Host ' to set a default -- or pass -AccountId on each call (Get-PDDomain, Get-PDHostedSPF, ...).' -ForegroundColor Yellow
        }
    }

    Write-Host $line -ForegroundColor Cyan
    Write-Host ''
}