vSphere PowerCLI Reference

New-CustomField

Synopsis

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. Creates a custom field for the object types that are provided by the Entity parameter.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
EntityInventoryItemSpecify the inventory objects for which you want to create a new custom field.truetrue (ByValue)
NameStringSpecify the name of the new custom field.truefalse
ValueStringSpecify 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$true
GlobalSwitchParameterIndicate that the new custom field apply to all types of objects.falsefalse
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

InventoryItem

Notes

In VirtualCenter 2.0, custom fields are global and apply to all objects. Fo r example, if a custom field is created for a Folder it is created for all inventory items (VM, VMHost, and so on). In VirtualCenter 2.5, you can define custom fields on a per-type basis. For example, if a custom field is created for a Folder it is created only for the Folder objects. VM, VMHost, and other objects do not have this custom field.

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 © 1998 - 2011 VMware, Inc. All rights reserved.