(edit: be sure to read the comments…and check out the Update-Tools cmdlet!)
If you already have the VM Tools installed in your guest OS, the VI Client gives you the capability to do an automated upgrade, provided the tools are of a recent enough version (3.0? 3.5? not sure). The VI Toolkit is the awesome, but there is no cmdlet included to kick off an upgrade. Luckily, it’s not hard to do.
Get-VM | % { (Get-View $_).UpgradeTools_Task($null) }
Note that the “%” is alias to the Foreach-Object cmdlet, and that even though the SDK docs say that the parameter to the UpgradeTools_Task() method is optional, I found it only worked if I stuck something in there.
The VM object returned by Get-VM doesn’t have any cool methods on it because of the way that VMware adapted the types for the administrator (you). But if you use Get-View on it, you’ll be able to use any method which is available to the “managed object”. Here’s a quote from their VI SDK about Managed Objects:
A “managed object type” is a core data structure of the server-side object model. Instances of various managed object types are referred to generically as “managed objects,” of which there are two broad categories:
- Managed objects that extend the ManagedEntity managed object type, and thus, are components that comprise the inventory of virtual components. For example, instances of datacenters (Datacenter), host systems (HostSystem), and virtual machines (VirtualMachine) are inventoried objects, and are referred to generically as “managed entities.”
- Managed objects that provide services for the entire system. Managed objects in this category enable managing performance (PerformanceManager), managing licenses for VMware products (LicenseManager), and managing virtual storage (VirtualDiskManager). These managed objects are the service interfaces for the virtual infrastructure management components.
Be sure to check out the SDK reference guide If you want to learn more about the VM managed object or the UpgradeTools_Task() method.

update-tools not getting any love? We worked hard on that one
Argh! I did it again! My bad, Carter.
In my defense, I’m writing the book in a certain order with the cmdlets arranged just so per each chapter. When I did the initial TOC, Update-Tools didn’t exist and I forgot about it.
Yeah so…it’s a good example anyway of beginner’s VI SDK work in the toolkit, so let’s read it that way.
[...] are a multitude of other scripts (including the powershell cmdlet “update-tools”) out there to kickoff a tools [...]