Edit

Share via


New-CMTSStepConditionOperatingSystemLanguage

Create an OS language condition for a task sequence step.

Syntax

Default (Default)

New-CMTSStepConditionOperatingSystemLanguage
    -OSLanguageId <Int32>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use this cmdlet to create an OS language condition object for a task sequence step. Then use one of the New-CMTSStep* or Set-CMTSStep* cmdlets with the Condition or AddCondition parameters. For example, Set-CMTSStepApplyDataImage.

For more information, see Use the task sequence editor: 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

This example first creates an OS language condition object for the Irish (Ireland) language.

It then uses the Set-CMTSStepSetDynamicVariable cmdlet to add this condition object to the Set Dynamic Variables step of the Default OS deployment task sequence.

$langIdIrish = 2108
$condition = New-CMTSStepConditionOperatingSystemLanguage -OSLanguageId $langIdIrish

$tsNameOsd = "AAron"
$tsStepNameDynVar = "Set Dynamic Variables"

Set-CMTSStepSetDynamicVariable -TaskSequenceName $tsNameOsd -StepName $tsStepNameDynVar -AddCondition $condition

This sample script creates the following condition on the step:

WMI Query SELECT OsLanguage FROM Win32_OperatingSystem WHERE OsLanguage='2108'

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
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

-OSLanguageId

Use this parameter to configure the specific OS language. This check compares the language ID to the OSLanguage property of the Win32_OperatingSystem WMI class on the client. For example, 1033 for English (United States).

This value is the decimal equivalent of the Windows language ID. For example, 1033 is 0x0409 for English (United States), and 2070 is 0x0816 for Portuguese (Portugal). For more information, see [MS-LCID]: Windows Language Code Identifier (LCID) Reference.

Parameter properties

Type:Int32
Default value:None
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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
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

None

Outputs

IResultObject

Notes

For more information on this return object and its properties, see SMS_TaskSequence_WMIConditionExpression server WMI class.

You can only set a single language ID per condition. To add a condition for multiple language IDs, first create multiple OS language conditions. Then nest them in an if statement condition with the New-CMTSStepConditionIfStatement cmdlet.

To get an OS language condition, use the Get-CMTSStepConditionQueryWmi cmdlet. The task sequence editor option to add an OS Language condition is a shortcut for a specific WMI query.