Remove-CMPackage

SYNOPSIS

Removes a Configuration Manager package.

SYNTAX

SearchByValue (Default)

Remove-CMPackage -InputObject <IResultObject> [-Force] [-DisableWildcardHandling] [-ForceWildcardHandling]
 [-WhatIf] [-Confirm] [<CommonParameters>]

SearchByIdMandatory

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

SearchByNameMandatory

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

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.

PARAMETERS

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
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
Parameter Sets: (All)
Aliases: 

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
Parameter Sets: (All)
Aliases: 

Required: False
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
Parameter Sets: (All)
Aliases: 

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

-Id

Specifies an array of package IDs.

Type: String
Parameter Sets: SearchByIdMandatory
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
Parameter Sets: SearchByValue
Aliases: 

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
Parameter Sets: SearchByNameMandatory
Aliases: 

Required: True
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
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

OUTPUTS

NOTES

Export-CMPackage

Get-CMPackage

Import-CMPackage

New-CMPackage

Set-CMPackage