Get-CMPackage

Get a Configuration Manager legacy package.

Syntax

Get-CMPackage
   [-Fast]
   [-Name <String>]
   [-PackageType <PackageType>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]
Get-CMPackage
   [-Fast]
   -Id <String>
   [-PackageType <PackageType>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]

Description

The Get-CMPackage cmdlet gets a Configuration Manager legacy package. 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.

Other objects are considered "packages" in certain contexts, but you need to use other cmdlets to get them. For more information, see the Related links.

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 all packages

This command gets all Configuration Manager legacy packages and stores them in the variable packages.

$packages = Get-CMPackage -PackageType RegularPackage

Example 2: Get a package by using an ID

This command gets the package that has the ID CM100002.

Get-CMPackage -Id "CM100002"

Example 3: Get a package by using a name

This command gets the package named Configuration Manager Client Package.

Get-CMPackage -Name "Configuration Manager Client Package"

Parameters

-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

-Fast

Add this parameter to not automatically refresh lazy properties. Lazy properties contain values that are relatively inefficient to retrieve. Getting these properties can cause additional network traffic and decrease cmdlet performance.

If you don't use this parameter, the cmdlet displays a warning. To disable this warning, set $CMPSSuppressFastNotUsedCheck = $true.

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

Specifies the package ID to get. For example, "CM100002".

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

-Name

Specifies the name of a package to get. For example, "Configuration Manager Client Package".

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

-PackageType

Specify a type of package to filter the result.

Type:PackageType
Accepted values:RegularPackage, Driver, TaskSequence, SoftwareUpdate, ContentPackage, ImageDeployment, BootImage, OSInstallPackage
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

IResultObject[]

IResultObject

Notes

For more information on this return object and its properties, see SMS_Package server WMI class.