Clear-XboxGamepadQueue.ps1

function Clear-XboxGamepadQueue
{
    <#
    .Synopsis
        Clears all packets from the queue for gamer input bound to the automation facility.
    .Description
        Clears all packets from the queue for gamer input bound to the automation facility.
    .Example
        Clear-XboxGamepadQueue 1
    .Parameter Player
        The number of the player (1-4)
    #>

    param(
    [Parameter()]
    [ValidateRange(1-4)]
    $Player
    )
    $result = $xbdm::DmAutomationClearGamepadQueue($player - 1)
    if ($Result -lt 0) {
        Write-Error ($xbdm)::DmTranslateError($Result)
    }
}