param(
    [string]$TaskPrefix = "FeishuDailyReport"
)

$ErrorActionPreference = "Stop"

foreach ($name in @("$TaskPrefix-Reminder", "$TaskPrefix-Summary")) {
    $task = Get-ScheduledTask -TaskName $name -ErrorAction SilentlyContinue
    if ($task) {
        Unregister-ScheduledTask -TaskName $name -Confirm:$false
        Write-Host "Removed task: $name"
    } else {
        Write-Host "Task not found: $name"
    }
}
