src/_Get-CciStoreIndexProblem.ps1

function _Get-CciStoreIndexProblem {
<#
.SYNOPSIS
    The one sentence a user should see when the distribution-store index could
    not be read.
.DESCRIPTION
    Kept in one place because Connect-CciGet, Install-CciModule and
    Publish-CciModuleToBlob have to say the same true thing about the same
    result. Until 0.6.2 they all said "no module index yet" whatever had gone
    wrong, so a rejected token read as an empty store and sent an operator
    hunting a publishing problem that did not exist.
 
    "no module index yet" is now reserved for the case where the store answered
    and there really is no index.
.PARAMETER Result
    A result object from _Get-CciBlobModuleIndexResult.
#>

    [CmdletBinding()]
    param(
        [Parameter(Mandatory)]$Feed,
        [Parameter(Mandatory)]$Result
    )

    $name = $Feed.name
    switch ($Result.Status) {
        'absent' {
            "cciget: the '$name' distribution store has no module index yet."
        }
        'auth' {
            "cciget: cannot read the '$name' distribution store - signed in to the wrong tenant, " +
            "or not signed in (HTTP $($Result.HttpStatus)). Run 'Connect-CciGet -Source Store' again " +
            "to sign in with a device code, or 'az logout' first if an unrelated Azure CLI session is in the way."
        }
        default {
            "cciget: cannot read the '$name' distribution store: $($Result.Message)"
        }
    }
}