Public/Get-P1Tenant.ps1

function Get-P1Tenant {
    <#
    .Synopsis
    Get PlannerOne tenant list and information.

    .Description
    Return the PlannerOne tenants informations

    .Parameter Tenant
    The tenant name.

    .Example
    # Get the list of tenants
    Get-P1Tenant

    .Example
    # Get a tenant information
    Get-P1Tenant -Tenant "PlannerOneProd"
    #>

    [cmdletbinding()]
    param( 
        [string] $Tenant
    )
    Process
    {
        $tenantsPath = Get-TenantsPath
        if (!(Test-Path $tenantsPath)) {
                return
        }

        if ($Tenant -eq "") {
            Get-TenantList
        } else {
            $info = Get-TenantInfo $Tenant
            if ($null -ne $info) {
                $revisionPath = $info.Path + "\revision.txt"
                if (Test-Path $revisionPath) {
                    $revision = Get-Content $revisionPath
                    Write-Output "Version: $revision"
                }
            }

            $info
        }
    }
}