Page 1 of 1

Modify description via script

Posted: 12. Apr 2013, 11:33
by ptulpen
Hello guys,
is there a way to modify a VMs description via script?
There is no documented switch for vboxmanage and I aldera tried to modify with this poershell script, which adds a decristion node, but this does not semm to be enough.

Code: Select all

[xml]$vminfo = Get-Content E:\VirtualBox\sccm2\sccm2.vbox
$mac = $vminfo.VirtualBox.Machine.Hardware.Network.FirstChild.MACAddress 

[...] here is some code which returns $vmname
 
$e = $vminfo.CreateElement("Description")
$e.set_InnerText($vmname)
$vminfo.VirtualBox.Machine.AppendChild($e)
$vminfo.save("E:\VirtualBox\sccm2\sccm2.vbox")
any ideas how to solve this?
Best regards,
Peter

Re: Modify description via script

Posted: 12. Apr 2013, 16:33
by noteirak
Moving to Using Virtualbox.

Interestingly enough, vboxmanage does not provide any switch for the description...
Unless you use one of the supported API, there is no safe way to make the change you want.