how do I get task events on a vm from date 4/1/2016 to 4/30/2016?
get-vievents only gets the events. what about tasks?
A Task fires a TaskEvent, you could do something like this
$start = Get-Date "April 1 2016"
$finish = Get-Date "April 30 2016"
$vm = Get-VM -Name MyVM
Get-VIEvent -Entity $vm -Start $start -Finish $finish -MaxSamples ([int]::MaxValue) |
where{$_ -is [VMWare.Vim.TaskEvent]}
As an alternative, have a look at my Task Data Mining – An improved Get-Task
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
A Task fires a TaskEvent, you could do something like this
$start = Get-Date "April 1 2016"
$finish = Get-Date "April 30 2016"
$vm = Get-VM -Name MyVM
Get-VIEvent -Entity $vm -Start $start -Finish $finish -MaxSamples ([int]::MaxValue) |
where{$_ -is [VMWare.Vim.TaskEvent]}
As an alternative, have a look at my Task Data Mining – An improved Get-Task
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Lucd