Public/Get-HibpSubscriptionStatus.ps1

function Get-HibpSubscriptionStatus {
    <#
        .SYNOPSIS
            Gets the status of the subscription for the API key.

        .DESCRIPTION
            Retrieves the subscription status for the provided API key, including when it expires and the number of searches remaining.
            This is a premium feature and requires a subscription.

        .PARAMETER ApiKey
            Your HIBP API key. Can be used instead of saving the key with Save-HibpCredential.

        .EXAMPLE
            Get-HibpSubscriptionStatus

            Returns the subscription status for the current API key.

        .LINK
            https://haveibeenpwned.com/API/v3#SubscriptionStatus
    #>


    [CmdletBinding()]
    Param(
        [string]$ApiKey
    )

    $invokeParams = @{
        Endpoint = 'subscription/status'
    }

    if ($PSBoundParameters.ContainsKey('ApiKey')) {
        $invokeParams.ApiKey = $ApiKey
    }

    Invoke-HibpRequest @invokeParams
}