Remove-CMProgram
Remove-CMProgram
Removes programs from a Configuration Manager package.
構文
Parameter Set: SearchByIdAndNameMandatory
Remove-CMProgram -PackageId <String> -ProgramName <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByValueMandatory
Remove-CMProgram -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
詳細説明
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.
パラメーター
-Force
Performs the action without a confirmation message.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-InputObject<IResultObject>
Specifies a CMProgram object. To obtain a CMProgram object, use the Get-CMProgram cmdlet.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-PackageId<String>
Specifies the package that contains the program by using an ID.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-ProgramName<String>
Specifies the program within the package by using a name.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-Confirm
コマンドレットを実行する前に、ユーザーに確認を求めます。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-WhatIf
コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
例
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" -PackageId "ST10000F"
PS C:\> Remove-CMProgram -InputObject $Prog