foreach ($VM in $thickVMs) {
$ds = Get-VMHost -VM $vm | Get-Datastore | where { ($_.name) -ne "ISOs" } |
sort FreespaceGB -Descending | select -First 1 | Select -ExpandProperty Name
$vm | Select Name,@{N="Datastore";E={$ds}}
}
They all show the same datastore, the one with the lowest space right now. I don't understand why the "where" isn't filtering it the right way. I guess the order needs to be changed, I'll experiment.