So for some reason when Get-VIEvent was written, it uses the Date/time interval as MM/DD/YEAR. It does not allow you to specify the time without parsing it.
Does anyone have any workarounds in order to get all events of any date for a specific time? Any ideas?
The Start and Finish parameters of the Get-VIEvent cmdlet expect a DateTime object as input. The Get-Date cmdlet returns a DateTime object. So, you can use the Get-Date cmdlet to return a specific time. The following command will return all of the events that happened between May 14th 2017 08:23 and 08:28.
Get-VIEvent -Start (Get-Date -Day 14 -Month 5 -Year 2017 -Hour 8 -Minute 23) -Finish (Get-Date -Day 14 -Month 5 -Year 2017 -Hour 8 -Minute 28)
The Start and Finish parameters of the Get-VIEvent cmdlet expect a DateTime object as input. The Get-Date cmdlet returns a DateTime object. So, you can use the Get-Date cmdlet to return a specific time. The following command will return all of the events that happened between May 14th 2017 08:23 and 08:28.
Get-VIEvent -Start (Get-Date -Day 14 -Month 5 -Year 2017 -Hour 8 -Minute 23) -Finish (Get-Date -Day 14 -Month 5 -Year 2017 -Hour 8 -Minute 28)