PowerCLI one-liner: remove the VMware tools mounted ISO

PowerCLI one-liner: remove the VMware tools mounted ISO

When you do an “Automatic Tools Upgrade” on a virtual machine the VMware tools iso will be mounted into the VM. Unfortunately it sometimes happens that after the upgrade the iso stays attached and this will result in a warning while doing a manual VMotion.

When you inspect the VM (edit settings) you will see the ISO being mounted.

You can change this to Client Device and the ISO will be unmounted and the warning won’t be shown anymore. Obviously this isn’t something you want to do manually on all your VMs and therefor the following PowerCLI one-liner will help you.

Get-VM | Get-CDDrive | Where { $_.IsoPath } | Set-CDDrive -NoMedia -Confirm:$false
Niels Engelen on GithubNiels Engelen on Twitter
Niels Engelen
Working as a Principal Analyst in Product Management for Veeam Software with an interest in anything virtual and cloud with a strong focus on AWS, Azure and Microsoft 365. He is also a VMware Certified Professional, a Veeam Certified Architect and gained the VMware vExpert award (2012-2022).

One thought on “PowerCLI one-liner: remove the VMware tools mounted ISO

Comments are closed.

Comments are closed.