Wednesday, November 6, 2019

List VMWare VM's with attached ISO's

Problem: I need to find all VM’s with ISO’s attached to the virtual CD-Roms.

Prerequisite: VMWare PowerCLI for PowerShell


Import-Module VMware.VimAutomation.Core | Out-Null
Connect-VIServer -Server $vCenter | Out-Null

#The actual working code to list attached ISO's
Get-VM | Get-CDDrive | Where-Object { $_.IsoPath -ne $null } | Select-Object Parent, IsoPath | Format-Table -auto

Disconnect-VIServer * -Confirm:$false -Force -ErrorAction SilentlyContinue

Good Luck!!!

& Thank you to Adil Arif & Brian Graf :

Written with StackEdit.