
Member-only story
How a PowerShell Script Saved My Sanity: Automating Work Hour Tracking
Not a Medium Member? Read here for free.
I know, tracking your working hours isn’t that hard, but it bothered me to manually write down my start and end of work every day. I thought: “There must be an easier way to do this”.
Every morning I start my computer and shut it down when I finish work. During lunch, I might log off or use hibernate/sleep mode. These actions surely must be logged somewhere. So I did a quick web search and found out, that you can see all these events in the…
Windows Event Viewer
Ah yes, good old Event Viewer… A neat tool to have when you need it. Never a great experience, though.

I can probably read these events with PowerShell instead, but let’s focus on finding the relevant events first. The events I definitively want to find are: startup, shutdown, log-on, log-off. These are probably documented on a Microsoft site…
“Many hours later”
no… no they aren’t… 😔 I found a few events I could use on Microsoft sites, but the most helpful resources were small tech…