
PowerCLI: List VMs and mounted ISOs
By: a guest on
Nov 15th, 2012 | syntax:
Power Shell | size: 0.21 KB | hits: 184 | expires: Never
foreach($vm in get-vm) {
foreach ( $Drive in ( get-cddrive $vm | where {$_.IsoPath -ne $null} ) ) {
$IsoSplit = $Drive.IsoPath.split('/') ;
write-host "$($VM.Name) `t $($IsoSplit[$IsoSplit.length-1])"
}
} ;