Pages: [1]
Print
Author Topic: List Poweredon VMs  (Read 1280 times)
dma0211
Newbie
*
Posts: 15


View Profile
« on: January 14, 2009, 07:38:13 AM »

Code:
$report = @()
$AllVM = Get-VM
foreach ($VM in $AllVM){
  if ($vm.PowerState -eq "PoweredOn") {
    $row = "" | add-member VMName
$row.VMName = $VM.Name
$report += $row
  }
}
$report | Export-Csv "C:\report.csv" -noTypeInformation
« Last Edit: January 14, 2009, 07:49:38 AM by esarakaitis » Logged
Pages: [1]
Print
Jump to: