PowerShell Ascii Art generated using Write-Ascii

Member-only story

How a PowerShell Script Saved My Sanity: Automating Work Hour Tracking

René Reifenrath
5 min readOct 25, 2024

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.

A Screenshot of the Windows Event Viewer, showing it’s ‘beautiful’ UI, which basically hasn’t changed since Windows XP

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…

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Written by René Reifenrath

I am a software developer from germany. Blogging about programming and tech related topics. I ❤️ open source and privacy.

No responses yet

Write a response