Advertisement
Guest User

PowerCLI: List VMs and mounted ISOs

a guest
Nov 15th, 2012
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. } ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement