Export-CMTaskSequence

Exports a task sequence.

Syntax

Export-CMTaskSequence
      [-Comment <String>]
      [-Confirm]
      [-DisableWildcardHandling]
      -ExportFilePath <String>
      [-ForceWildcardHandling]
      -InputObject <IResultObject>
      [-WhatIf]
      [-WithContent <Boolean>]
      [-WithDependence <Boolean>]
      [<CommonParameters>]
Export-CMTaskSequence [-Comment ] [-Confirm] [-DisableWildcardHandling] -ExportFilePath 
 [-ForceWildcardHandling] -Name  [-WhatIf] [-WithContent ] [-WithDependence ]
 []
Export-CMTaskSequence [-Comment ] [-Confirm] [-DisableWildcardHandling] -ExportFilePath 
 [-ForceWildcardHandling] -TaskSequencePackageId  [-WhatIf] [-WithContent ]
 [-WithDependence ] []

Description

The Export-CMTaskSequence cmdlet exports a Microsoft System Center Configuration Manager task sequence to a .zip file.

Examples

Example 1: Get a task sequence and export it

PS C:\> $TaskSequence = Get-CMTaskSequence -Name "TaskSequence01"
PS C:\> Export-CMTaskSequence -InputObject $TaskSequence -ExportFilePath "\\Server1\TS\TaskSequence01.zip"

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

The second command exports the task sequence stored in $TaskSequence to the specified location.

Example 2: Get a task sequence and use the pipeline to export it

PS C:\> Get-CMTaskSequence -Name "TaskSequence02" | Export-CMTaskSequence -ExportFilePath "\\Server1\TS\TaskSequence02.zip"

This command gets the task sequence object named TaskSequence02 and uses the pipeline operator to pass the object to Export-CMTaskSequence, which exports the task sequence object to the specified location.

Required Parameters

-ExportFilePath

Specifies a path for the exported .zip file.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-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 for the task sequence.

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

Specifies the ID of a task sequence.

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

Optional Parameters

-Comment

Specifies a comment for the task sequence.

Type:String
Aliases:Comments
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-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
-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
-WithContent

Indicates whether to include content associated with the task sequence in the export .zip file.If you specify a value of $True, the cmdlet copies the content from the package source to the export location, and uses the import path as the new package source location.

Type:Boolean
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WithDependence

Indicates whether to include dependencies in the export .zip file.Specify a value of $True to scan for all the related objects and export them with the task sequence that includes any dependencies for applications. To export only the task sequence XML without the other referenced objects, set this parameter to $False.

Type:Boolean
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False