Changed the script a bit to use the $VMView a bit more.
I'm not sure what you did why you only see 1 VM. But here it works properly, try to describe the exact steps you do and what output you get, might be able to help you better then.
1)
$Report = @()
$VMs = Get-VM | Where {$_.PowerState -eq "PoweredOn"}
ForEach ($VM in $VMs) {
$VMView = $VM | Get-View |Select config,summary
$VMInfo = {} | Select VMName,OS,IPAddress
$VMInfo.VMName = $VMView.Config.name
$VMInfo.OS = $VMView.summary.Guest.Guestfullname
$VMInfo.IPAddress = $VMView.summary.Guest.IpAddress
$Report += $VMInfo
}
$Report = $Report | Sort-Object VMName
$report | Export-Csv c:\output.csv
}
2 ) To find your independent persistent disks or change it to your needs :smileyhappy:
get-vm | Get-HardDisk | where {$_.Persistence -eq "IndependentPersistent"}