New-CMDeviceCollectionVariable

SYNOPSIS

Creates a device collection variable.

SYNTAX

NewByValueMandatory (Default)

New-CMDeviceCollectionVariable -InputObject <IResultObject> -VariableName <String> [-Value <String>]
 [-IsMask <Boolean>] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]
 [<CommonParameters>]

NewByIdMandatory

New-CMDeviceCollectionVariable -CollectionId <String> -VariableName <String> [-Value <String>]
 [-IsMask <Boolean>] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]
 [<CommonParameters>]

NewByNameMandatory

New-CMDeviceCollectionVariable -CollectionName <String> -VariableName <String> [-Value <String>]
 [-IsMask <Boolean>] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

The New-CMDeviceCollectionVariable cmdlet creates a device collection variable. You can use a device collection variable to define custom task sequence variables and their associated values to be used by the resources in a 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.

EXAMPLES

Example 1: Create a device collection variable

PS C:\> $Collection = Get-CMCollection -Name "Device"
PS C:\> New-CMDeviceCollectionVariable -Collection $Collection -VariableName "testTS" -Value "test001"

The first command gets the device collection object named Device and stores the object in the $Collection variable.

The second command creates a collection variable named testTS with the value test001 for the collection object stored in $Collection.

PARAMETERS

-CollectionId

Specifies the ID of a device collection.

Type: String
Parameter Sets: NewByIdMandatory
Aliases: 

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

-CollectionName

Specifies the name of a device collection.

Type: String
Parameter Sets: NewByNameMandatory
Aliases: 

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

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

-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

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

-InputObject

Specifies a device collection object. To obtain a collection object, use the Get-CMCollection cmdlet.

Type: IResultObject
Parameter Sets: NewByValueMandatory
Aliases: Collection

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-IsMask

Indicates whether the collection variable value displays in the Configuration Manager console.

Type: Boolean
Parameter Sets: (All)
Aliases: 

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

-Value

Specifies a value for the collection variable.

Type: String
Parameter Sets: (All)
Aliases: VariableValue

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

-VariableName

Specifies a name for the collection variable.

Type: String
Parameter Sets: (All)
Aliases: 

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

-WhatIf

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

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

OUTPUTS

NOTES

Planning a Task Sequence Strategy in Configuration Manager

Get-CMCollection

Get-CMDeviceCollectionVariable

Set-CMDeviceCollectionVariable

Remove-CMDeviceCollectionVariable

Get-CMUserCollection