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