PowerWF News, Tutorials, and more...

Get the latest tips and tricks directly from the PowerWF development team. Find out about new releases and upcoming features.


Seamless Automation

From the Desktop to the Data Center

The PowerWF family of products are easy enough for desktop and departmental automation, yet powerful and scalable enough for the Data Center. PowerWF compliments Opalis and other RBA solutions, lets you leverage your workforce and preserves your investment as your automation needs grow.


Special - 20% Discount


In conjunction with our recently announced Silver Award from Windows IT Magazine we would like to offer our customers an opportunity to save 20% off any Devfarm product purchase through the end of the year. This includes all PowerWF products as well as Devfarm's new PowerVI product!

PowerVI

vSphere Automation fueled by PowerShell


Designed for the VMware Administrator, PowerVI eases the automation of vSphere infrastructures. PowerVI includes over 100 PowerShell automation scripts that simplify everyday VMware administration tasks and PowerVI makes it easy to author new scripts.
November 17, 2011

Using New-VIProperty to get VM Tools Version

Alan Renouf has a new blog post up that takes advantage of the New-VIProperty cmdlet to add the VMware tools version to the get-vm cmdlet.  you may recall that Luc Dekens had a rather extensive post a while back that talked about many cool things you could do using the New-VIProperty cmdlet.

Here’s Alan’s use case…

If we look at the  object which gets returned back when we use the Get-VM cmdlet you will see […] the returned object doesn’t have a root property for ToolsVersion or ToolsVersionStatus, for this we need to delve into the ExtensionData property and have a look around, once we have found the information it is fairly easy to add these to our object using the New-VIProperty cmdlet as below:

New-VIProperty -Name ToolsVersion -ObjectType VirtualMachine `
    -ValueFromExtensionProperty ‘Config.tools.ToolsVersion’ `
    -Force

New-VIProperty -Name ToolsVersionStatus -ObjectType VirtualMachine `
    -ValueFromExtensionProperty ‘Guest.ToolsVersionStatus’ `
    -Force

Now we have added these as a new property to our object (actually they are PowerShell Code Properties), we can use our old friend Get-VM to retrieve the information easily:

Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus

(read more)

It looks like Alan’s use case looks like it may already be covered, but I figured I would post the information anyway.



blog comments powered by Disqus