Hi,
I use the below script to find the average cpu performance of the esxi hosts in my environment:
$clu = get-cluster Clustername
$esx = $cluster | Get-VMHost | Where {$_.ConnectionState -eq "Connected"}
$statcpu = Get-Stat -Entity ($esx) -start (get-date).AddDays(-7) -Finish (Get-Date) -MaxSamples 10000 -stat cpu.usage.average
$cpu = $statcpu | Measure-Object -Property value -Average -Maximum
Now from the last line of the code when collecting the average values it is also taking the values which is presented as 0 (zero) for any time interval(s).
So just wanted to know if there is any way we can discard the values which is coming as 0 and then take the average of the remaining values.
Please help.