Remove-CMGlobalCondition
Removes a Configuration Manager global condition object.
Syntax
Remove-CMGlobalCondition
[-Force]
-InputObject <IResultObject>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMGlobalCondition
[-Force]
-Id <String>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMGlobalCondition
[-Force]
-Name <String>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-CMGlobalCondition cmdlet removes a global condition object.
Configuration Manager uses global conditions to represent business or technical conditions. Global conditions specify how to provide and deploy applications to client devices.
You can specify a global condition by name or ID or use the Get-CMGlobalCondition cmdlet to obtain a global condition object. You cannot remove read-only global conditions.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Remove a global condition
PS XYZ:\> Remove-CMGlobalCondition -Name "GC56" -Force
This command removes a global condition named GC56. Because the command uses the Force parameter, the system does not prompt you before it removes the condition.
Example 2: Remove a global condition using a variable
PS XYZ:\> $CMGC = Get-CMGlobalCondition -Name "GC57"
PS XYZ:\> Remove-CMGlobalCondition -InputObject $CMGC
Remove
Are you sure you wish to remove GlobalCondition:
LocalizedDisplayName=" GC57"?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
The first command uses the Get-CMGlobalCondition cmdlet to get the global condition named GC57 and stores it in the $CMGC variable.
The second command removes the global condition stored in that variable. This command does not use the Force parameter, so it prompts you for confirmation before it removes the global condition.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
Performs the action without a confirmation message.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
Specifies an array of identifiers of global conditions. This value corresponds to the CI_ID property of a global condition object.
Type: | String |
Aliases: | CIId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Specifies a global condition object. To obtain a global condition object, use the Get-CMGlobalCondition cmdlet.
Type: | IResultObject |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies an array of names for global conditions. This value corresponds to the LocalizedDisplayName property of a global condition object.
Type: | String |
Aliases: | LocalizedDisplayName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | True |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
Outputs
System.Object