Most types of vSphere Tasks generate a TaskEvent.
With this small change, you can get all TasEvents, and it shows which task it actually was.
Get-VIEvent -Start (Get-Date).AddHours(-1) -MaxSamples ([int]::MaxValue) |
Where {$_ -is [VMware.Vim.TaskEvent]} |
Select CreatedTime,@{N="Task";E={$_.Info.Name}},UserName,@{N="VM";E={$_.Vm.Name}}
The Start and Finish parameters accept a DateTime object, which contains the date and the time.
In my example I take the current date and time, and substract 1 hour. So as a result I get the events for the past hour.
The documentation just says that the date part can be specified either way, depending on the locale settings.