I have a requirement is to capture the first “Kernel-Boot” time on current day.
The cmdlet/script I am currently using is as below, which gives me the latest 10 entries.
“Get-EventLog -LogName System -Message “Kernel-Boot” -Newest 10 |select -Property Source,TimeGenerated,TimeWritten |sort timeGenerated -Descending |ConvertTo-Html |Out-File C:\MyWeb.html”.
I worked on -After & -Before parameters and was not successful at getting desired result. I am looking for a simple solution. Appreciate if someone can help me here.