New-CMRequirementRuleBooleanValue

Create a requirement rule to evaluate a boolean global condition on an application deployment type.

Syntax

New-CMRequirementRuleBooleanValue
   -Value <Boolean>
   [-InputObject] <IResultObject>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]

Description

Use this cmdlet to create a requirement rule on an application deployment type that evaluates a boolean global condition. The global condition defines the specific criteria, and this requirement rule evaluates the boolean state of that global condition on the device.

After you use this cmdlet, then use one of the Add- or Set- cmdlets for deployment types. Pass this requirement rule object to either the AddRequirement or RemoveRequirement parameters.

For more information, see Deployment type Requirements and Create 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: Check for co-managed state

This example first uses the Get-CMGlobalCondition cmdlet to get the default Co-managed device global condition. Next it creates the requirement rule object to evaluate the global condition as $true. Finally it passes that rule object to the Set-CMScriptDeploymentType cmdlet to add the requirement.

$myGC = Get-CMGlobalCondition -Name "Co-managed device"
$myRule = New-CMRequirementRuleBooleanValue -GlobalCondition $myGC -Value $true

Set-CMScriptDeploymentType -ApplicationName "Central app" -DeploymentTypeName "Install" -AddRequirement $myRule

You can also use this example with the default Primary device global condition, which is the only default User type global condition.

Parameters

-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

-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

-InputObject

Specify a boolean global condition object to use as the basis for this requirement rule. To get this object, use the Get-CMGlobalCondition cmdlet.

To see the list of available boolean global conditions at the site, use the following PowerShell command:

Get-CMGlobalCondition | Where-Object DataType -eq "Boolean" | Select-Object LocalizedDisplayName

Type:IResultObject
Aliases:GlobalCondition
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Value

Specify the boolean state that this requirement rule should evaluate the global condition on the device. In other words, if you want to require the global condition to be true on the device, set this parameter to $true.

Type:Boolean
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object