Quantcast
Channel: VMware Communities : All Content - VMware PowerCLI
Viewing all articles
Browse latest Browse all 16717

Export CSV - Multiple VMs hard disks information

$
0
0

All

I started a powercli below to extract harddisk information and generate a csv file.

The problem here is that information being exported is only for one vm, and not all vms included in  GetVMList.txt are being exported.

Anyone can give me solution, I appreciate any comments.

 

 

$VMs = Get-content E:\vmw\GetVMList.txt

Write-Host "Collecting Vm hard disks information..." -ForegroundColor Yellow

Foreach ($vm in $VMs){

  Get-vm $vm | get-harddisk | select Parent,StorageFormat,DiskType,Filename,CapacityGB,Persistence,Name | Export-Csv e:\vmw\output\VM_disks.csv –NoTypeInformation

}

Write-Host "Done." -foreground Green


Viewing all articles
Browse latest Browse all 16717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>