Hello there,
You can use the below PowerShell script to Compare the Time of an Event generated with the Current time.
$timeGenerated=(get-WinEvent @{LogName='Microsoft-windows-International/operational';id=1001} -maxevents 1).TimeGenerated
$diffMinutes=(New-TimeSpan $timeGenerated (Get-Date)).TotalMinutes
You can also use the Get-EventLog cmdlet gets events and event logs from local and remote computers. By default, Get-EventLog gets logs from the local computer. To get logs from remote computers, use the ComputerName parameter.
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer–