vSphere PowerCLI Reference

New-CustomField

Synopsis

This cmdlet creates a new custom field for a particular inventory item type.

Syntax

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

Related Commands

Online version
Remove-CustomField
Set-CustomField

Detailed Description

This cmdlet is deprecated and scheduled for removal.
This cmdlet creates a custom field for the object types that are provided by the Entity parameter.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
EntityInventoryItemSpecifies the inventory objects for which you want to create a new custom field.truetrue (ByValue)
NameStringSpecifies the name of the new custom field.truefalse
ValueStringSpecifies the value of the new 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
GlobalSwitchParameterIndicates that the new custom field applies to all types of objects.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 --------------

New-CustomField -Entity VM -Name CPUMaxLoad -Value 300

Creates a custom field named CPUMaxLoad for the VM virtual machine, and sets it initial value to 300. The command returns the virtual machine VM, to which the new custom field belongs.


Copyright © VMware, Inc. All rights reserved.