Stop-ReceivingGamepadInput.ps1

function Stop-ReceivingGamepadInput
{
    <#
    .Synopsis
        Stops a gamepad from recieving automated input and restores normal user interaction.
    .Description
        Stops a gamepad from recieving automated input and restores normal user interaction.
    .Example
        Stop-ReceivingGamepadInput
    .Parameter Player
        The number of the player (1-4). Defaults to player 1
    #>

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