Public/Get-GhostPost.ps1

function Get-GhostPost {
    [OutputType('pscustomobject')]
    [CmdletBinding(DefaultParameterSetName = 'None')]
    param
    (
        [Parameter(ParameterSetName = 'ById')]
        [ValidateNotNullOrEmpty()]
        [string]$Id,

        [Parameter(ParameterSetName = 'BySlug')]
        [ValidateNotNullOrEmpty()]
        [string]$Slug,

        [Parameter()]
        [ValidateNotNullOrEmpty()]
        [string]$Title
    )

    $ErrorActionPreference = 'Stop'

    $invParams = @{
        Api = 'content'
    }
    if ($PSBoundParameters.Keys -notcontains 'Id' -and $PSBoundParameters.Keys -notcontains 'Id') {
        $invParams.Endpoint = 'posts'
    } elseif ($PSBoundParameters.ContainsKey('Id')) {
        $invParams.Endpoint = "posts/$Id"
    } elseif ($PSBoundParameters.ContainsKey('Slug')) {
        $invParams.Endpoint = "posts/slug/$Slug"
    }
    Invoke-GhostApiCall @invParams
}