Export-CMPackage

Export a legacy package.

Syntax

Export-CMPackage
      [-Comment <String>]
      -FileName <String>
      [-Force]
      -InputObject <IResultObject>
      [-WithContent <Boolean>]
      [-WithDependence <Boolean>]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Export-CMPackage
      [-Comment <String>]
      -FileName <String>
      [-Force]
      -Id <String>
      [-WithContent <Boolean>]
      [-WithDependence <Boolean>]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Export-CMPackage
      [-Comment <String>]
      -FileName <String>
      [-Force]
      -Name <String>
      [-WithContent <Boolean>]
      [-WithDependence <Boolean>]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Use this cmdlet to export a Configuration Manager legacy package. You can use the Import-CMPackage cmdlet to import a legacy package to another site.

Configuration Manager current branch continues to support packages and programs that were used in Configuration Manager 2007. For more information, see Packages and programs in Configuration Manager.

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: Export a package by using an ID

This command exports a package that has the ID ST120001 to a network path.

Export-CMPackage -Id "ST120001" -FileName "\\Deploy01\ExportPackages\ST120001.zip"

Example 2: Export a package by using a variable

The first command gets the package that has the ID ST120001, and then stores it in the variable $DeplObj. The second command exports the package to the network path by using the variable.

$DeplObj = Get-CMPackage -Id "ST120001"
Export-CMPackage - "ST120001" -FileName "\\Deploy01\ExportPackages\ST120001.zip" -InputObject $DeplObj

Parameters

-Comment

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

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

-FileName

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

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

-Force

Run the command without asking for confirmation.

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

-Id

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

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

-InputObject

Specify a package object to export. To get this object, use the Get-CMPackage cmdlet.

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

-Name

Specify the name of a package to export.

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

-WithContent

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

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

-WithDependence

Set this parameter to $true to export all package dependencies.

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

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object