Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232413

Re: I was so happy when the script was running, but I made a mistake

$
0
0

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.


Viewing all articles
Browse latest Browse all 232413

Trending Articles



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