Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Remove-CMPackage

Updated: February 7, 2014

Applies To: System Center 2012 R2 Configuration Manager

Remove-CMPackage

Removes a Configuration Manager package.

Syntax

Parameter Set: SearchByIdMandatory
Remove-CMPackage -Id <String[]> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByNameMandatory
Remove-CMPackage -Name <String> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValue
Remove-CMPackage -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

The Remove-CMPackage cmdlet removes a package in Microsoft System Center 2012 Configuration Manager. You can delete a package from the site where it was created. System Center 2012 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 2012 Configuration Manager removes it from the database. If the package was sent to child sites, System Center 2012 Configuration Manager removes the package information at those child sites. If a compressed version of source files for the package exists, System Center 2012 Configuration Manager deletes the compressed file from the site server.

Parameters

-Force

Performs the action without a confirmation message.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String[]>

Specifies an array of package IDs.


Aliases

PackageId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

Specifies a CMPackage object. To obtain a CMPackage 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 an array of package names.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SecuredScopeNames<String>

Specifies names of security scopes. A security scope name can be Default or the name of a custom-created security scope.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.


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.

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: Remove a package

This command removes the package that has the ID CM10000D.


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

Example 2: Remove a package by using an object variable

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

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


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

Related topics

 
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.