vSphere PowerCLI Reference

Set-CustomField

Synopsis

This cmdlet modifies the value of a custom field for a specified inventory item.

Syntax

Set-CustomField [-Entity] <InventoryItem> [-Name] <String> [[-Value] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
New-CustomField
Remove-CustomField

Detailed Description

This cmdlet is deprecated and scheduled for removal.
This cmdlet modifies the value of a custom field for a specified inventory item. If the custom field with this name does not exist, it is created for this type of items and then its value is set.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
EntityInventoryItemSpecifies the inventory item to which the custom field you want to change belongs.truetrue (ByValue)
NameStringSpecifies the name of the custom field you want to change.truefalse
ValueStringProvides a new value for the custom field.falsefalse
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

The specified InventoryItem object

Notes

Examples

-------------- Example 1 --------------

Get-VM VM | Set-CustomField -Name CF - Value 10

Sets the value of the CF custom field of the VM virtual machine.


Copyright © VMware, Inc. All rights reserved.