Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

PowerCLI: List VMs and mounted ISOs

By: a guest on Nov 15th, 2012  |  syntax: Power Shell  |  size: 0.21 KB  |  views: 240  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. } ;