param(
    [string]$TaskName = "RalphInboxDaemon"
)

try {
    Unregister-ScheduledTask -TaskName $TaskName -Confirm:$false -ErrorAction Stop
    @{
        task_name = $TaskName
        removed = $true
    } | ConvertTo-Json -Depth 20
}
catch {
    @{
        task_name = $TaskName
        removed = $false
        error = $_.Exception.Message
    } | ConvertTo-Json -Depth 20
}
