Edit

Share via


Export-CMPackage

Export a legacy package.

Syntax

SearchByValue (Default)

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

SearchPackageByIdMandatory

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

SearchPackageByNameMandatory

Export-CMPackage
    -FileName <String>
    -Name <String>
    [-Comment <String>]
    [-Force]
    [-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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Comments

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableWildcardHandling

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FileName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:FilePath, ExportFilePath, Path

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Run the command without asking for confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:PackageId

Parameter sets

SearchPackageByIdMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

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

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchByValue
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specify the name of a package to export.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchPackageByNameMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WithContent

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

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WithDependence

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

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object