Export-CMPackage

Exports a Configuration Manager package.

Syntax

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

Description

The Export-CMPackage cmdlet exports a Microsoft System Center Configuration Manager package. You can use this cmdlet in System Center 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.

Examples

Example 1: Export a package by using an ID

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

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

Example 2: Export a package by using a variable

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

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.

Required Parameters

-FileName
Type:String
Aliases:ExportFilePath
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

Specifies an array of IDs for packages.

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

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

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies a name of a package.

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

Optional Parameters

-Comment
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

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

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

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

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

Indicates whether to include content in the package.

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

Indicates whether to include dependencies in the package.

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