Ben Armstrong offers yet another use for the Set and GetConfigValue within Virtual Server. This time, he shows you how to use it to extend the virtual machine configuration files to store arbitrary data. Here is his script that creates a new custom key and stores a value in it:
Set vs = CreateObject("VirtualServer.Application")
set vm1 = vs.FindVirtualMachine(WScript.Arguments(0))
key = "Bens_Test_Key/Some_Value"
Result = vm1.SetConfigurationValue(key, "Hello World")
Wscript.echo "Fetching custom key: " & key & " value: " & vm1.GetConfigurationValue(key)
He explains, this is useful if you need to store extra information about a virtual machine and is then easy and accessible to get to. The key cannot contain spaces or invalid file characters such as ( / and \ ). As usual, thanks Ben!
Read his original article and comment, here.