Werbung

Herkunft

Kurzinformation

Removes a scheduled task

Syntax

<# .Synopsis Removes a scheduled task .Description Removes a scheduled task from the computer. .Example New-Task | Add-TaskAction -Script { Get-Process | Out-GridView Start-Sleep 100 } | Register-ScheduledTask (Get-Random) | Remove-Task #> [CmdletBinding(DefaultParameterSetName="Task")] param( # The Name of the task to remove [Parameter(Mandatory=$true, ParameterSetName="Name")] [String] $Name, # The scheduled task to remove. This value can be supplied with the output of Get-ScheduledTask [Parameter(ParameterSetName="Task", ValueFromPipeline=$true)] $Task, # The folder the scheduled task is in [Parameter()] [String[]] $Folder = "", # If this is set, hidden tasks will also be shown. # By default, only tasks that are not marked by Task Scheduler as hidden are shown. [Switch] $Hidden, # The name of the computer to connect to. $ComputerName, # The credential used to connect [Management.Automation.PSCredential] $Credential, # If set, will get tasks recursively beneath the specified folder [switch] $Recurse ) process { switch ($psCmdlet.ParameterSetName) { Task { $scheduler = Connect-ToTaskScheduler -ComputerName $ComputerName -Credential $Credential $folder =$scheduler.GetFolder("") $folder.DeleteTask($task.Path, 0) } Name { Get-ScheduledTask @PSBoundParameters | Remove-Task } } }

Beschreibung

Removes a scheduled task from the computer.

Links

Liste aller Commandlets Mehr über die Windows PowerShell

Bücher zur PowerShell

Buchcover Windows PowerShell 5.0 - Das Praxishandbuch (1. Auflage 2016/5. Auflage Gesamtreihe) Windows PowerShell 5.0 - Das Praxishandbuch (1. Auflage 2016/5. Auflage Gesamtreihe)
Autoren: Dr. Holger Schwichtenberg
erschienen 2016, 996 Seiten, 49,99 €
ISBN: 3446446435
Bestellung: Amazon.de oder im Buchhandel über ISBN 3446446435

Schulungen/Seminare

Offene Seminare zur PowerShell
In-House-Seminare zur PowerShell