Remove-CMDeviceCollectionVariable

Remove-CMDeviceCollectionVariable

Removes a task sequence variable that is associated with a device collection in the Configuration Manager hierarchy.

Syntax

Parameter Set: SearchByIdMandatory
Remove-CMDeviceCollectionVariable -CollectionId <String> -VariableName <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByNameMandatory
Remove-CMDeviceCollectionVariable -CollectionName <String> -VariableName <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValueMandatory
Remove-CMDeviceCollectionVariable -Collection <IResultObject> -VariableName <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Remove-CMDeviceCollectionVariable cmdlet removes a task sequence variable that is associated with the specified device collection in Microsoft System Center 2012 SP1 Configuration Manager.

These variables are used by task sequences that are deployed to the collection.

Parameters

-Collection<IResultObject>

Specifies an object that represents the device collection.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CollectionId<String>

Specifies the ID of a 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 a device collection.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Force

Forces the command to run without asking for user confirmation.

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 that this cmdlet removes.

Aliases

none

Required?

true

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: Remove a task sequence variable from a device collection

This command removes a task sequence variable named New_ComputerName that is associated with a device collection named All Unknown Devices.

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

Get-CMDeviceCollectionVariable

Set-CMDeviceCollectionVariable

New-CMDeviceCollectionVariable