Sure is. Here's a snippet that uses the -PipelineVariable parameter available since PowerShell v4 to get such info:

Get-Datacenter-PipelineVariableoThisDatacenter | %{## get all of the clusters in this datacenterGet-Cluster-Location$oThisDatacenter-PipelineVariableoThisCluster | %{## get all of the VMs in this cluster, and their HDisksGet-VM-Location$oThisCluster | Get-HardDisk |Select @{n="VM"; e={$_.Parent}}, @{n="HardDisk"; e={$_}}, @{n="Datastore"; e={$_.Filename.Split("]")[0].Trim("[")}}, StorageFormat, @{n="Cluster"; e={$oThisCluster}}, @{n="DataCenter"; e={$oThisDatacenter}} }

}

And, I added the Cluster and Datastore properties for each object, assuming that would be useful at some point. If not, just remove those items from the Select statement, of course. How's that do for you?

Well, that depends upon the things upon which you want to report. As written, the code will:

get all datacenters

for each datacenter, get all clusters

for each cluster, get all VMs

for each VM, get its hard disks

for each hard disk, return a selected object that includes info like the VM of the hard disk, the datastore on which the hard disk resides, the storage format of the hard disk, and the cluster and datacenter of the VM

If you wanted to narrow this down, you could add a datacenter name in the Get-Datacenter portion, or adjust it a bit to just report on a particular cluster (remove the Get-Datacenter portion altogether, and the DataCenter calculated property on the Select statement), and so on.

Is that helpful, or do you have a specific/different way in which you want to use the code?