Remove-CMProgram

Removes programs from a Configuration Manager package.

Syntax

Remove-CMProgram
      [-Confirm]
      [-DisableWildcardHandling]
      [-Force]
      [-ForceWildcardHandling]
      -InputObject <IResultObject>
      [-WhatIf]
      [<CommonParameters>]
Remove-CMProgram [-Confirm] [-DisableWildcardHandling] [-Force] [-ForceWildcardHandling] -PackageId 
 -ProgramName  [-WhatIf] []

Description

The Remove-CMProgram cmdlet removes one or more programs from a Microsoft System Center Configuration Manager package. Programs are commands that are associated with a System Center 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 Configuration Manager updates the package information in the System Center Configuration Manager site database. System Center 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 Configuration Manager has already run the advertised program on the client computer, System Center Configuration Manager does not remove the software.

Examples

Example 1: Remove a program by using a name and an ID

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

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

Example 2: Remove a program by using an object variable

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

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

The second command removes program in $Prog.

Required Parameters

-InputObject

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

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

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

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

Specifies the program within the package by using a name.

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