- Local time
- 9:05 AM
- Posts
- 84
- OS
- Windows 11
Anyone know if it's possible to use a time range when using Get-WinEvent in powershell? It works with StartTime but not if I set EndTime.
Works:
Error:
}
Get-WinEvent : No events were found that match the specified selection criteria.
At line:1 char:1
+ Get-WinEvent -FilterHashTable @{LogName='Application';StartTime='01/0 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-WinEvent], Exception
+ FullyQualifiedErrorId : NoMatchingEventsFound,Microsoft.PowerShell.Commands.GetWinEventCommand
Works:
Powershell:
Get-WinEvent -FilterHashTable @{'LogName' = 'Application'; 'StartTime' = Get-Date "November 26, 2023 14:00:00"; }
Error:
Powershell:
Get-WinEvent -FilterHashTable @{'LogName' = 'Application'; 'StartTime' = Get-Date "November 26, 2023 14:00:00"; 'EndTime' = Get-Date "November 26, 2023 14:01:00"
Get-WinEvent : No events were found that match the specified selection criteria.
At line:1 char:1
+ Get-WinEvent -FilterHashTable @{LogName='Application';StartTime='01/0 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-WinEvent], Exception
+ FullyQualifiedErrorId : NoMatchingEventsFound,Microsoft.PowerShell.Commands.GetWinEventCommand
My Computer
System One
-
- OS
- Windows 11
- Computer type
- PC/Desktop
- Manufacturer/Model
- Asus
- CPU
- Intel Core i7-13700
- Motherboard
- ASUS TUF GAMING B760-PLUS WIFI
- Memory
- Corsair VENGEANCE DDR5 32GB
- Graphics Card(s)
- MSI GeForce RTX 4060 Ti VENTUS 3X 16GB OC
- Monitor(s) Displays
- Samsung LS32AG504
- Hard Drives
- Kingston Fury Renegade M.2 2TB SSD
- PSU
- Corsair RM850X 2021 / 850W / 80+ Gold
- Browser
- Chrome
- Antivirus
- Defender