More PowerShell Goodness

One of the greatest things about working with/on VMware is the attention they pay to the community that has built up around their products. The community itself becomes a great resource for feedback to the company and for support to new users. Their PowerShell community is no exception to this. Here is a post on their PowerShell blog highlighting their commitment to the community, as well as pointing out several good tips/tricks.

Templates can be quite big and pose a challenge to storage management, so it’s nice to be able to move them around. Moving templates across datastores is something the VI Toolkit doesn’t do out of the box, but not to worry, Niket shows how you can move templates across datastores by accessing the VI API.

 

Even though the VI Toolkit doesn’t have a cmdlet for it, Hal shows that it’s pretty easy to reboot or shut down an ESX host with PowerShell.

If you need to add an unregistered VM to ESX or VC, Luc shows how you can register a VM based on its VMX file. One of these days we’ll be adding an Add-VM cmdlet that will make this really easy, but this is a workable solution in the meantime.

 

With the Toolkit it’s really easy to get a listing of all disks associated with a VM, however it doesn’t help you identify what disk it is within the VM itself. This week, a couple of solutions have been proposed, one from adavidm and one from Hugo Peeters. Both these scripts rely on a combination of some of the advanced data available through VI API and also getting information out of a Windows VM via WMI