Export-CMPackage

Export-CMPackage

Exports a Configuration Manager package.

Syntax

Parameter Set: SearchPackageByNameMandatory
Export-CMPackage -ExportFilePath <String> -Name <String> [-Comments <String> ] [-WithContent <Boolean> ] [-WithDependence <Boolean> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValue
Export-CMPackage -ExportFilePath <String> -InputObject <IResultObject> [-Comments <String> ] [-WithContent <Boolean> ] [-WithDependence <Boolean> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchPackageByIdMandatory
Export-CMPackage -ExportFilePath <String> -Id <String[]> [-Comments <String> ] [-WithContent <Boolean> ] [-WithDependence <Boolean> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Export-CMPackage cmdlet exports a Microsoft System Center 2012 SP1 Configuration Manager package. You can use this cmdlet in System Center 2012 Configuration Manager to create a package of collections, queries, or reports and then export that package so that you can later deploy these items to a different location.

Parameters

-Comments<String>

Specifies a comment to include in the package.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ExportFilePath<String>

Specifies the Universal Naming Convention (UNC) path to which you export the package. This path must end with the filename extension .zip.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String[]>

Specifies an array of IDs for packages.

Aliases

PackageId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

Specifies the package that you export by using a Configuration Manager package object. To obtain a package object, use the Get-CMPackage cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies a name of a package.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-WithContent<Boolean>

Indicates whether to include content in the package.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-WithDependence<Boolean>

Indicates whether to include dependencies in the package.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Export a package by using an ID

This command exports a package that has the ID ST120001 to the output path \\Deploy01\ExportPackages.

PS C:\> Export-CMPackage -Id "ST120001" -ExportFilePath "\\Deploy01\ExportPackages"

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 path \\Deploy01\ExportPackages by using the $DeplObj variable.

PS C:\> $DeplObj = Get-CMPackage -Id "ST120001"
PS C:\> Export-CMPackage - "ST120001" -ExportFilePath"\\Deploy01\ExportPackages" -InputObject $DeplObj

Import-CMPackage

Get-CMPackage

New-CMPackage

Remove-CMPackage

Set-CMPackage