powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Set-CustomField



NAME
Set-CustomField

SYNOPSIS
Sets the value of a custom field for a particular inventory item.

SYNTAX
Set-CustomField [-Entity] [-Name] [[-Value] ] [-WhatIf] [-Confirm] [ ers>]


DESCRIPTION
This cmdlet is deprecated and scheduled for removal. Sets the value of a custom field for a particular inventory it
em. If the custom field with this name does not exist, it is created for this type of items and then its value is s
et.


PARAMETERS
-Entity
Specify the inventory item to which the custom field you want to change belongs.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Name
Specify the name of the custom field you want to change.

Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Value
Provide a new value for the custom field.

Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm
If 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.

Required? false
Position? named
Default value $true
Accept pipeline input? false
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
InventoryItem


NOTES


In VirtualCenter 2.0, custom fields are global and apply to objects of all types. For example, if a custom fiel
d is created for a Folder it will be created for VM, VMHost and so on. for all other inventory items.
In VirtualCenter 2.5, you can define custom fields on a per-type basis. For example, if a custom field is creat
ed for a Folder, it will be created only for the Folder objects - VMs, VMHosts and others will not have this cu
stom field.

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

C:\PS>Get-VM VM | Set-CustomField -Name CF - Value 10


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






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Set-CustomField.html
New-CustomField
Remove-CustomField