Public/Get-DattoBcdrAlert.ps1

function Get-DattoBcdrAlert {
<#
.SYNOPSIS
Returns alerts for a BCDR device.
.DESCRIPTION
Implements GET /v1/bcdr/device/{serialNumber}/alert. The supplied API contract documents only the page parameter for this operation.
.PARAMETER SerialNumber
The BCDR device serial number.
.PARAMETER Page
The one-based API page number.
.PARAMETER All
Retrieves every available page.
.PARAMETER RawResponse
Returns the response envelope.
.PARAMETER Connection
A connection object, name, or ID.
.EXAMPLE
Get-DattoBcdrAlert -SerialNumber 'ABC123ABC1' -All
#>

    [CmdletBinding()]
    param(
        [Parameter(Mandatory, ValueFromPipelineByPropertyName)][ValidateNotNullOrEmpty()][string]$SerialNumber,
        [Parameter()][ValidateRange(1, [int]::MaxValue)][int]$Page = 1,
        [Parameter()][switch]$All,
        [Parameter()][switch]$RawResponse,
        [Parameter()][AllowNull()][object]$Connection
    )
    process {
        $serial = ConvertTo-DattoApiPathSegment -Value $SerialNumber
        Invoke-DattoApiRequest -Path "/v1/bcdr/device/$serial/alert" -Query @{ _page = $Page } -All:$All -ResultProperty 'items' -RawResponse:$RawResponse -Connection $Connection
    }
}