Hi,
thanks for your prompt reply.
I now get the metric for "Past Day" interval . i guess it need time to build for "Past Week" ( also in level 2).
Now this command Works :
PS C:\Windows\system32> Get-Stat -Entity (Get-VM my-vm) -Stat mem.active.average -IntervalMins 5 -MaxSamples 3 | where{$_.instance -eq ""}
MetricId Timestamp Value Unit Instance
-------- --------- ----- ---- --------
mem.active.average 24/01/2013 13:45:00 0 KB
mem.active.average 24/01/2013 13:40:00 748226 KB
mem.active.average 24/01/2013 13:35:00 351286 KB
But, when i"m trying to use the start/finish , i get the mistake,
$today = (Get-Date -Hour 10 -Minute 30 -Second 0)
$now = (Get-Date -Hour 13 -Minute 30 -Second 0)
Get-Stat -Entity (Get-VM my-vm) -Stat mem.active.average -Start $today -Finish $now | where{$_.Instance -eq ""}
Get-Stat : 24/01/2013 13:53:14 Get-Stat Object reference not set to an instance of an object.
At line:3 char:9
+ Get-Stat <<<< -Entity (Get-VM my-vm) -Stat mem.active.average -Start $today -Finish $now | where{$_.Instance -eq ""}
+ CategoryInfo : NotSpecified: (:) [Get-Stat], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetViStats
please advise.
thanks, Avi