Hi Luc,
I am using the attached script which is your one from your blog with timings changed slightly.
As for my attempts at getting the export per machine, please don't ask, as I've butchered it now and didn't version track.
One copy of the script had in it the below, but this exported information which was not part of the filtered report (do I just need to do a select instead of sort-object?).
ForEach ($entity in $entities){
$report = Get-Stat -Entity $entity -Stat $metrics -start $Morning -Finish $Night -IntervalMins 5 | where { $_.value -ne "-0.01" }
$report | Group-Object -Property EntityId,Timestamp | %{
New-Object PSObject -Property @{
Name = $_.Group[0].Entity.Name
Time = $_.Group[0].Timestamp
CpuAvg = ($_.Group | where {$_.MetricId -eq "cpu.usage.average"}).Value
MemAvg = ($_.Group | where {$_.MetricId -eq "mem.usage.average"}).Value
}
$report | Sort-Object Time | Export-Csv ".\$entity_$Datefile.csv" -NoTypeInformation -UseCulture
}
}
The version I had where I changed the method I cannot find a working copy, unfortunately, or maybe fortunately.
Geoff