7.2

Table Of Contents
Table 444. Scripting Examples for the Computed Property Option
Sample String Property Script Sytax Sample Usage
my_unique_id = "" Bash - $my_unique_id
export
my_unique_id="012345678
9"
Windows CMD - %my_unique_id%
set
my_unique_id=0123456789
Windows PowerShell - $my_unique_id
$my_unique_id =
"0123456789"
String Property
String properties expect string values. You can supply the string yourself, require someone else to supply
the value, or retrieve the value from another blueprint component by creating a binding to another string
property. String values can contain any ASCII characters. To create a property binding, use the
Properties tab on the design canvas to select the appropriate property for binding. The property value is
then passed to the action scripts as raw string data. When you bind to a blueprint string property, make
sure the blueprint component you bind to is not clusterable. If the component is clustered, the string value
becomes an array and you do not retrieve the value you expect.
Sample String Property Script Syntax Sample Usage
admin_email = "admin@email987.com" Bash - $admin_email
echo $admin_email
Windows CMD - %admin_email%
echo %admin_email%
Windows PowerShell - $admin_email
write-output $admin_email
Array Property
Array properties expect an array of string, integer, decimal, or boolean values defined as [“value1”,
“value2”, “value3”…]. You can supply the values yourself, require someone else to supply the values, or
retrieve the values from another blueprint component by creating a property binding. When you define
values for an array property you must enclose the array in square brackets. For an array of strings, the
value in the array elements can contain any ASCIl characters. To properly encode a backslash character
in an Array property value, add an extra backslash, for example, ["c:\\test1\\test2"]. For a bound
property, use the Properties tab in the design canvas to select the appropriate property for binding. If you
bind to an array, you must design your software components so they don't expect a value array in any
specific order.
For example, consider a load balancer virtual machine that is balancing the load for a cluster of
application server virtual machines. In such a case, an array property is defined for the load balancer
service and set to the array of IP addresses of the application server virtual machines.
Configuring vRealize Automation
VMware, Inc. 403