Remove-CMPackage

Removes a Configuration Manager package.

Syntax

Remove-CMPackage
      [-Confirm]
      [-DisableWildcardHandling]
      [-Force]
      [-ForceWildcardHandling]
      -Id <String>
      [-WhatIf]
      [<CommonParameters>]
Remove-CMPackage [-Confirm] [-DisableWildcardHandling] [-Force] [-ForceWildcardHandling]
 -InputObject  [-WhatIf] []
Remove-CMPackage [-Confirm] [-DisableWildcardHandling] [-Force] [-ForceWildcardHandling] -Name 
 [-WhatIf] []

Description

The Remove-CMPackage cmdlet removes a package in Microsoft System Center Configuration Manager. You can delete a package from the site where it was created. System Center Configuration Manager cannot delete a package from a distribution point if a user has locked a network file.

When you remove a package, System Center Configuration Manager removes it from the database. If the package was sent to child sites, System Center Configuration Manager removes the package information at those child sites. If a compressed version of source files for the package exists, System Center Configuration Manager deletes the compressed file from the site server.

Examples

Example 1: Remove a package

PS C:\> Remove-CMPackage -Id "CM10000D"

This command removes the package that has the ID CM10000D.

Example 2: Remove a package by using an object variable

PS C:\> $Pkg = Get-CMPackage -Id "CM10000D"
PS C:\> Remove-CMPackage -InputObject $Pkg

The first command gets the package that has the ID CM10000D, and then stores the results to the $Pkg variable.

The second command removes the package stored in the $Pkg variable.

Required Parameters

-Id

Specifies an array of package IDs.

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

Specifies a CMPackage object. To obtain a CMPackage object, use the Get-CMPackage cmdlet.

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

Specifies an array of package names.

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

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

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

Forces the command to run without asking for user confirmation.

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

Indicates that wildcard handling is enabled.

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