Remove-CMTaskSequence

Removes a task sequence.

Syntax

Remove-CMTaskSequence
      [-Confirm]
      [-DisableWildcardHandling]
      [-Force]
      [-ForceWildcardHandling]
      -InputObject <IResultObject>
      [-WhatIf]
      [<CommonParameters>]
Remove-CMTaskSequence [-Confirm] [-DisableWildcardHandling] [-Force] [-ForceWildcardHandling] -Name 
 [-WhatIf] []
Remove-CMTaskSequence [-Confirm] [-DisableWildcardHandling] [-Force] [-ForceWildcardHandling]
 -TaskSequencePackageId  [-WhatIf] []

Description

The Remove-CMTaskSequence cmdlet removes a task sequence from Microsoft System Center Configuration Manager.

NOTE: All related deployments are automatically removed.

Examples

Example 1: Remove a task sequence by using a variable

PS C:\> $TaskSequence = Get-CMTaskSequence -Name "TaskSequence01"
PS C:\> Remove-CMTaskSequence -InputObject $TaskSequence -Force
Remove
Are you sure you wish to remove TaskSequence: Name="General Sequence 11"?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):

The first command gets the task sequence object named TaskSequence01 and stores the object in the $TaskSequence variable.

The second command removes the task sequence object stored in $TaskSequence. Specifying the Force parameter indicates that the user is not prompted before the task sequence is removed.

Example 2: Remove a task sequence by using the pipeline

PS C:\> Get-CMTaskSequence -Name "TaskSequence02" | Remove-CMTaskSequence -Force

This command gets the task sequence object named TaskSequence02 and uses the pipeline operator to pass the object to Remove-CMTaskSequence, which removes the task sequence object. Specifying the Force parameter indicates that the user is not prompted before the task sequence is removed.

Required Parameters

-InputObject

Specifies a task sequence object. To obtain a task sequence object, use the Get-CMTaskSequence cmdlet.

Type:IResultObject
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies a name of a task sequence.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TaskSequencePackageId

Specifies the package ID of a task sequence.

Type:String
Aliases:PackageId
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False