New-CMDeviceCollectionVariable

New-CMDeviceCollectionVariable

Creates a task sequence variable for a device collection in the Configuration Manager hierarchy.

Syntax

Parameter Set: NewByNameMandatory
New-CMDeviceCollectionVariable -CollectionName <String> -VariableName <String> [-IsMask <Boolean> ] [-VariableValue <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: NewByIdMandatory
New-CMDeviceCollectionVariable -CollectionId <String> -VariableName <String> [-IsMask <Boolean> ] [-VariableValue <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: NewByValueMandatory
New-CMDeviceCollectionVariable -Collection <IResultObject> -VariableName <String> [-IsMask <Boolean> ] [-VariableValue <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The New-CMDeviceCollectionVariable cmdlet creates a task sequence variable for the device collection. You can specify the device collection by its name, ID, or specify on object that represents the collection.

Task sequence variables are a set of name and value pairs that provide a mechanism to configure and customize the steps of a task sequence when the task sequence is deployed to a specific collection. For more information about task sequence variables, see Planning a Task Sequence Strategy in Configuration Manager (https://go.microsoft.com/fwlink/p/?LinkID=260806) on TechNet.

Parameters

-Collection<IResultObject>

Specifies a Configuration Manager user collection object. To obtain a user collection object, use the Get-CMUserCollection cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CollectionId<String>

Specifies the ID of the device collection.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CollectionName<String>

Specifies the name of the device collection.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-IsMask<Boolean>

Indicates whether a value displays in the Configuration Manager console.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-VariableName<String>

Specifies the name of the task sequence variable.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-VariableValue<String>

Specifies a value that you assign to a collection variable in Configuration Manager.

Custom task sequence variables include sets of name and value pairs that supply configuration and operating system deployment settings for a device, operating system and user state configuration tasks on a Configuration Manager client computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Create a task sequence variable

This command creates a task sequence variable named New_ComputerName for the device collection named All Unknown Devices.

PS C:\> New-CMDeviceCollectionVariable -CollectionName "All Unknown Devices" -VariableName "New_ComputerName"

Get-CMDeviceCollectionVariable

Set-CMDeviceCollectionVariable

Remove-CMDeviceCollectionVariable

Get-CMUserCollection

Planning a Task Sequence Strategy in Configuration Manager