Export-CMTaskSequence

Export a task sequence.

Syntax

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

Description

Use this cmdlet to export a task sequence from Configuration Manager. You can use the Import-CMTaskSequence cmdlet to import a task sequence to another site.

Important

This cmdlet doesn't support PowerShell 7. It requires the .NET Framework instead of .NET Core that's used with PowerShell version 7.

Starting in version 2103, if you try to use this cmdlet in a PowerShell version 7 session, it fails with the following error: This cmdlet only supports the ".NET Framework" runtime.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Get a task sequence and export it

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.

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

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

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.

Get-CMTaskSequence -Name "TaskSequence02" | Export-CMTaskSequence -ExportFilePath "\\Server1\TS\TaskSequence02.zip"

Parameters

-Comment

Specify an optional administrator comment. This comment displays in the Import Task Sequence Wizard.

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

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

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

-ExportFilePath

Specify the network path for the task sequence. The path needs to specify the file, including the .zip extension.

Type:String
Aliases:FileName, FilePath, Path
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Force

Run the command without asking for confirmation.

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

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

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

-InputObject

Specify a task sequence object to export. To get this object, use the Get-CMTaskSequence cmdlet.

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specify the name of a task sequence to export.

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

-TaskSequencePackageId

Specify the task sequence ID to export. This value is the standard package ID, for example XYZ00123.

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

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

-WithContent

Set this parameter to $true to export all content for the task sequence and dependencies.

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

-WithDependence

Set this parameter to $true to export all task sequence dependencies.

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

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object