This is a little PowerShell script that helps you track your working hours by analyzing your machine's uptime.
It reads the required information from the system log and outputs it as a table.
The script does not store any data on your computer. It only uses the data that Windows automatically provides.
Use the batch files to get a first impression!
- Read and follow the instructions on PowerShell’s execution policy
 
then
- Start PowerShell
 - Type 
.\goodTimes.ps1 <any parameters> 
or
- Run 
powershell.exe -file goodTimes.ps1 <any parameters> 
installInstalls a scheduler in Windows Task Scheduler to display a warning when the maximum allowed working hours has been reached (default parameters are used if no further parameters are specified).install_widgetInstalls a scheduler in Windows Task Scheduler to display a widget at logon (installation needs admin rights).uninstallUninstalls the scheduler to display a warning when the maximum allowed number of working hours has been reached.uninstall_widgetUninstalls the scheduler to display a widget at logon (deinstallation needs admin rights).checkChecks if the maximum allowed number of working hours has already been reached and displays a warning if necessary (normally only called internally by the scheduler).widgetLaunches a widget to display all relevant information about your working time.-historyLength(Alias-l) Number of days to show in uptime history. Defaults to60.-workingHours(Alias-h) Working hours per day, used for overtime calculation. Defaults to8.-breakfastBreak(Alias-b1) Length of breakfast break in hours per day. This will be added to your daily work time. Defaults to0.25.-lunchBreak(Alias-b2) Length of lunch break in hours per day. This will be added to your daily work time. Defaults to0.50.-precision(Alias-p) Rounding precision in percent, where 1 = round to the hour, 2 = round to 30 minutes, etc. Defaults to60.-dateFormat(Alias-d) Date format according to the .NET reference. Defaults toddd dd/MM/yyyy.-joinIntervals(Alias-j) Ignores the breaks between the intervals and combines only the start of the first interval and the end of the last interval (0 = switched off, 1 = switched on). Defaults to1.-maxWorkingHours(Alias-m) Number of maximum allowed hours per day that can be worked. Defaults to10.-showLogoff(Alias-i) Show logoff/login events and lockscreen on/off events (0 = switched off, 1 = switched on). Defaults to1.
$cultureInfo(Defaultde-DE) Can be set e.g. to en-GB or en-US.$breakDeduction1(Default3.0) After how many hours should the breakfastBreak be deducted.$breakDeduction2(Default6.0) After how many hours should the lunchBreak be deducted.
Sorry, this version is in English only, so if you want some internationalization, you can easily edit the script.





