Share via


Remove-CMProgram

Remove-CMProgram

Removes programs from a Configuration Manager package.

Syntax

Parameter Set: SearchByIdAndNameMandatory
Remove-CMProgram -PackageId <String> -ProgramName <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValueMandatory
Remove-CMProgram -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Remove-CMProgram cmdlet removes one or more programs from a Microsoft System Center 2012 Configuration Manager package. Programs are commands that are associated with a System Center 2012 Configuration Manager package. Programs identify the actions that occur when the client receives the client package. You can associate multiple programs with the same package.

When you remove a program from a package, System Center 2012 Configuration Manager updates the package information in the System Center 2012 Configuration Manager site database. System Center 2012 Configuration Manager removes all of the advertisements for this program from the database and removes the advertisements from clients that have received them. If System Center 2012 Configuration Manager has already run the advertised program on the client computer, System Center 2012 Configuration Manager does not remove the software.

Parameters

-Force

Removes the program without prompting you for confirmation. By default, the cmdlet prompts you for confirmation before it proceeds.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PackageId<String>

Specifies the package that contains the program by using an ID.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ProgramName<String>

Specifies the program within the package by using a name.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).

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 program by using a name and an ID

This command removes the program named ProgramD02 from the package that has the ID ST10000F.

PS C:\> Remove-CMProgram -PackageId "ST10000F" -ProgramName "ProgramD02"

Example 2: Remove a program by using an object variable

The first command gets the program named ProgramD02 in the package that has the ID ST10000F and assigns the results to the $Prog variable.

The second command removes program stored in $Prog.

PS C:\> $Prog = Get-CMProgram -Name "ProgramD02" -ID "ST10000F"
PS C:\> Remove-CMProgram -InputObject $Prog

Get-CMProgram

Enable-CMProgram

Disable-CMProgram