Create a Script-Based Custom Property for a vSphere Object
You can create a custom property by writing a script and providing a name for the property. The script evaluates when the custom property is called for the first time.
Prerequisites
Verify that you are connected to a vCenter Server system.
Procedure
Results
You created a custom script property named NameOfHost for VirtualMachine objects.