w10install/scripts/A.ps1
Michael H.G. Schmidt a07ac3307b .
2021-05-26 23:06:15 +02:00

10 lines
391 B
PowerShell

$taskName = The task name;
$task = Get-ScheduledTask | Where-Object { $_.TaskName -eq $taskName } | Select-Object -First 1
if ($null -ne $task) {
$task | Unregister-ScheduledTask -Confirm:$false
Write-Host Task $taskName was removed -ForegroundColor Yellow
}
if (Get-ScheduledTask -TaskName $TaskName){Unregister-ScheduledTask -TaskName $TaskName -Confirm $false}