Public/PartnerCenter/Get-PartnerCustomer.ps1

function Get-PartnerCustomer {
    [CmdletBinding()]
    param(
        [Parameter()]
        [string]$CustomerTenantId
    )

    try {
        $customers = (Invoke-PartnerCenterRequest -Uri "https://api.partnercenter.microsoft.com/v1/customers?size=9999").items
        if($CustomerTenantId) {
            return $customers | Where-Object { $_.companyProfile.tenantId -eq $CustomerTenantId }
        } else {
            return $customers
        }
    }
    catch {
        throw [TokenOperationException]::new(
            'PartnerCenter',
            "Failed to get customer information: $($_.Exception.Message)",
            $_
        )
    }
}