Modify description via script

This is for discussing general topics about how to use VirtualBox.
Post Reply
ptulpen
Posts: 3
Joined: 18. Mar 2013, 12:39

Modify description via script

Post 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
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Modify description via script

Post 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.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply