- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to call Update-Tools -NoReboot if not running/current?
I am trying to come up with a script to loop through the VMs on a particular vcenter to install/update vmware-tools if it's not in "guestToolsCurrent" format, and ideally, to give a confirmation prompt before it runs the Update-Tools function. Tried hacking some pieces of CLI code but not having much success. It would be awesome If someone can help me with a template to work off from.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use something like:
Get-VM | Where-Object {$_.ExtensionData.Guest.ToolsVersionStatus -eq 'guestToolsNeedUpgrade'} | Update-Tools -NoReboot
Unfortunately you cannot use the -Confirm parameter with the Update-Tools cmdlet.
Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition