Usually, I don’t post powershell code, simply because there’s so much good stuff out there to write about – but this one caught my eye considering how useful this feature would be just before scheduled downtime.
You’ll need the VI powershell toolkit for this:
$cluster = "< >" # Enter the required cluster name
$installerArgs = 'REBOOT="ReallySuppress"'
Get-Cluster -Name $cluster | Get-VM | % { (Get-View $_).UpgradeTools_Task($installerArgs) }
Hat-tip to VM Guru (Russian)
Cheers,
Leo
So, does “all” mean “all” or just “all Windows”?
[...] posted a brief snippet of code to upgrade the VMware Tools on VMs without a reboot. It looks like it might come in handy. And [...]
Hey! Have you tried this? I tried in our test enviroment and recieved the following:
Get-View : 12/19/2008 5:20:49 PM Get-View Invalid object specified for parameter Id – ‘VirtualMachineImpl’. Valid types are
ManagedObjectReference and string.
At line:1 char:53
+ Get-Cluster -Name testintel | Get-VM | % { (Get-View <<<< $_).UpgradeTools_Task($installerArgs) }
You cannot call a method on a null-valued expression.
At line:1 char:75
Thanks!
Michael
Hi Michael,
It looks like the command you’ve tested seems to have an invalid Get-View suffix with the <<<<
That’s not in the command…
[...] Upgrading VI tools on all VMs without reboot | Leo's Ramblings VI powershell toolkit (tags: vmware powershell) [...]
[...] Upgrading VI tools on all VMs without reboot | Leo's Ramblings VI powershell toolkit (tags: vmware powershell) [...]
[...] Mettre à jour les vmtools sans reboot en script [...]