Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

Introducing a PowerShell To-Do Manager

Posted on August 26, 2016August 26, 2016

I don't know about you but I always have a PowerShell session open and find it easier to manage my day right from a prompt.  I find ways to use PowerShell whenever I can. Recently I started a project to help me manage my work and of course I created it in PowerShell.  I had been keeping daily to-do lists on paper with little tasks or reminders. I work from home and don't have an assistant or anything so I am responsible for my own schedule. Sometimes I need a little help remembering what to work on next or what's upcoming. so I created a PowerShell module called MyTasks.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

As I was developing the module I considered several options for storing my task or to-do data. A database seemed the likely candidate but I didn't want to have to include any dependencies or complicate the installation and setup. I thought about SQL Server Express and even NoSQL and SQLite. But in the end I realized I'll only ever need to manage a small set of items and only for myself. Storing data in a file should be just fine. I then decided on storing the data in an XML file. I also made the big decision to use a PowerShell class to define the task item.

My strategy was to use the XML file for persistent storage and when I needed to work with the tasks, write functions to create instances of the class populated with data from the XML file. To add a new task is as easy as this.

image

The command allows me to set a due date by an actual date, or I can specify a certain number of days.

image

Did you notice the Category? By default, the module supports a pre-defined set of categories.

image

But you can create your own list. Once you do, the default categories are ignored unless you add them back.

image

The functions that use categories have a dynamic parameter to autoload the values. Let me jump into the PowerShell ISE to demonstrate.

image

Use Get-MyTask to view all of the tasks.

image

The default is to show all tasks that have not been completed. There are a few other options so look at help for Get-MyTask.

Or course I need to be able to modify a task to show I'm working on it, or to change properties like the due date or category.

image

I also wrote an alternative to Get-MyTask called Show-MyTask that only writes to the console using Write-Host. I did this so that I could colorize the output to show me overdue and almost due tasks.

image

The default is to ignore completed tasks unless I use -All. And completing tasks is as easy as running Complete-MyTask -name Demo.

There are a few other commands in the module you can look at. Everything should have complete help and examples. There is even an About help topic

image

So where can you get your hands on this? Right now this is still a project on GitHub. I'd love for at least a few people to try it out, kick it around and let me know what you think.  At some point I can then publish it to the PowerShell Gallery.  But for now, test it out from GitHub and post any questions, comments or suggestions in the Issues section.

Enjoy staying organized. I know I do.


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

11 thoughts on “Introducing a PowerShell To-Do Manager”

  1. Petr Kubát says:
    August 26, 2016 at 2:01 pm

    Hello, nice work. One question though: have you considered to use todo.txt format (http://todotxt.com/)? There are several advantages of that approach – easily readable and editable by human (XML is not, really), huge number of compatible apps and scripts on any platform you can imagine. Thanks for your public work anyway 😉

    1. Jeffery Hicks says:
      August 26, 2016 at 3:59 pm

      There are plenty of tools that do what my module does. That’s not really the point. Most of the time I publish things like this as learning exercises or as a vehicle for me to explain or demonstrate something in PowerShell.

      1. Mukesh says:
        August 27, 2016 at 6:02 am

        I agree

  2. Ben says:
    August 26, 2016 at 2:09 pm

    I like it. Reminds me of something similar that Lee Holmes did with adding Tasks using Outlook as a COM Object.

    http://www.leeholmes.com/blog/2007/03/01/getting-things-done-outlook-task-automation-with-powershell/

  3. David says:
    August 26, 2016 at 2:36 pm

    When I run Show-MyTask it errors out. Says “write-host : cannot process the color because -1 is not a valid color.”

    1. Jeffery Hicks says:
      August 26, 2016 at 3:58 pm

      This may not work in the PowerShell ISE

  4. David says:
    August 26, 2016 at 2:37 pm

    Update: it only does that when I run it in ISE. Console works fine

  5. Mukesh says:
    August 27, 2016 at 6:00 am

    Good Stuff Jeffery and Interesting take on using PowerShell.
    I will try this out shortly.

  6. Itamar Tziger says:
    August 28, 2016 at 4:17 am

    Does it popup a message on due date ?

    1. Jeffery Hicks says:
      August 28, 2016 at 8:38 am

      No. But you could write a script to do that.

  7. Matt says:
    September 6, 2016 at 6:47 am

    That looks good.

    On a similar topic, but at a very much more basic level, I’ve started putting this in my Pester scripts:

    function todo {
    param ([string]$TodoText)
    write-host -foregroundcolor DarkYellow ” [o] Todo: $TodoText”
    }

    It’s a bit kludge-y, but I’ve found it useful when I think of something that I need to do, but don’t have time to write a proper test for.

Comments are closed.

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d