New-CMRequirementRuleOperatingSystemLanguageValue
Create an OS language requirement rule for an application deployment type.
Syntax
Default (Default)
New-CMRequirementRuleOperatingSystemLanguageValue
-Culture <CultureInfo[]>
[-IsMobile <Boolean>]
-RuleOperator <RuleExpressionOperator>
[-InputObject] <IResultObject>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Description
Use this cmdlet to create an OS language requirement rule for an application deployment type.
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: Add a requirement rule for an OS language
This example first uses the Get-CMGlobalCondition cmdlet to get the default OS language global condition for non-mobile Windows devices. It then defines variables for two locales, Irish (Ireland) (ga-IE
) and Hungarian (Hungary) (hu-HU
). Next it creates the requirement rule object to include these two locales. Finally it passes that rule object to the Set-CMScriptDeploymentType cmdlet to add the requirement.
$myGC = Get-CMGlobalCondition -Name "Operating System Language" | Where-Object PlatformType -eq 1
$cultureA = [System.Globalization.CultureInfo]::GetCultures([System.Globalization.CultureTypes]::AllCultures) | Where-Object Name -eq "ga-IE"
$cultureB = [System.Globalization.CultureInfo]::GetCultures([System.Globalization.CultureTypes]::AllCultures) | Where-Object Name -eq "hu-HU"
$myRule = $myGC | New-CMRequirementRuleOperatingSystemLanguageValue -RuleOperator OneOf -Culture $cultureA,$cultureB -IsMobile $False
Set-CMScriptDeploymentType -ApplicationName "Central App" -DeploymentTypeName "Install" -AddRequirement $myRule
Parameters
-Culture
Specify one or more culture objects. Use the following syntax to specify a culture object:
[System.Globalization.CultureInfo]::GetCultures([System.Globalization.CultureTypes]::AllCultures)
By default, Windows has over 800 cultures built-in. To filter the results, pass the results of the above command through the pipeline to the Where-Object cmdlet. Filter on one of the following properties:
- LCID: The language code identifier. For example, English (United States) is
1033
. - Name: The language code name. For example, English (United States) is
en-US
. - Display name: The language display name. For example,
English (United States)
.
For more information and a list of cultures, see Windows Language Code Identifier (LCID) Reference.
Parameter properties
Type: | CultureInfo[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | Cultures |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-InputObject
Specify a global condition object to use as the basis for this requirement rule. To get this object, use the Get-CMGlobalCondition cmdlet.
In most instances, you'll use the default Operating system language global condition for non-mobile Windows devices. For example: Get-CMGlobalCondition -Name "Operating System Language" | Where-Object PlatformType -eq 1
.
Note
By default, Configuration Manager has two global conditions named Operating system language. You can distinguish them by device type using the PlatformType property:
PlatformType | Device type |
---|---|
1 |
Windows |
2 |
Mobile |
Parameter properties
Type: | IResultObject |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | GlobalCondition |
Parameter sets
(All)
Position: | 0 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-IsMobile
If you use the mobile device type global condition, set this parameter to $true
.
If you get the OS language global condition with PlatformType -eq 1
, don't include this parameter or set it to $false
.
Parameter properties
Type: | Boolean |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-RuleOperator
Specify the operator to compare the device's setting with the expected value.
Parameter properties
Type: | RuleExpressionOperator |
Default value: | None |
Accepted values: | OneOf, NoneOf |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
Outputs
System.Object
Related Links
- New-CMRequirementRuleActiveDirectorySiteValue
- New-CMRequirementRuleBooleanValue
- New-CMRequirementRuleCMSiteValue
- New-CMRequirementRuleCommonValue
- New-CMRequirementRuleDeviceOwnershipValue
- New-CMRequirementRuleExistential
- New-CMRequirementRuleExpression
- New-CMRequirementRuleFileAttributeValue
- New-CMRequirementRuleFilePermissionValue
- New-CMRequirementRuleFreeDiskSpaceValue
- New-CMRequirementRuleInputTypeValue
- New-CMRequirementRuleOperatingSystemValue
- New-CMRequirementRuleOUValue
- New-CMRequirementRuleRegistryKeyPermissionValue
- New-CMRequirementRuleScreenResolutionValue
- Get-CMGlobalCondition
- Deployment type Requirements
- Create global conditions
- Windows Language Code Identifier (LCID) Reference