SHARE
TWEET

PowerCLI: List VMs and mounted ISOs

a guest Nov 15th, 2012 284 Never
  1. foreach($vm in get-vm) {
  2.         foreach ( $Drive in ( get-cddrive $vm | where {$_.IsoPath -ne $null} ) ) {
  3.                 $IsoSplit = $Drive.IsoPath.split('/') ;
  4.                 write-host "$($VM.Name) `t $($IsoSplit[$IsoSplit.length-1])"
  5.         }
  6. } ;
RAW Paste Data
Top