Remove-CMTaskSequence

Removes a task sequence.

Syntax

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

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
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies a name of a task sequence.

Type:String
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
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
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type:SwitchParameter
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
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
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
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False