This blog is about Java (advanced Java topics like Reflection, Byte Code transformation, Code Generation), Maven, Web technologies, Raspberry Pi and IT in general.

Posts mit dem Label windows 7 werden angezeigt. Alle Posts anzeigen
Posts mit dem Label windows 7 werden angezeigt. Alle Posts anzeigen

Sonntag, 17. Januar 2016

How to get the boot time of a Windows 7 or Windows 10 system with Powershell

I must admit that i have a quite bad memory. Most of the time I can't remember when I arrived at work. But there is a quite easy way to figure it out, if the first thing you do is to turn on the computer. With this little Powershell command you see the time of the first system event. Because if you turn on the computer and login will generate system events this method is quite accurate.

> Get-EventLog System -After (Get-Date -F 'yyyy-MM-dd') | select -Last 1 | % {$_.TimeGenerated.ToString("HH:mm")}