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.
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.
The command allows me to set a due date by an actual date, or I can specify a certain number of days.
Did you notice the Category? By default, the module supports a pre-defined set of categories.
But you can create your own list. Once you do, the default categories are ignored unless you add them back.
The functions that use categories have a dynamic parameter to autoload the values. Let me jump into the PowerShell ISE to demonstrate.
Use Get-MyTask to view all of the tasks.
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.
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.
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
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.
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 😉
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.
I agree
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/
When I run Show-MyTask it errors out. Says “write-host : cannot process the color because -1 is not a valid color.”
This may not work in the PowerShell ISE
Update: it only does that when I run it in ISE. Console works fine
Good Stuff Jeffery and Interesting take on using PowerShell.
I will try this out shortly.
Does it popup a message on due date ?
No. But you could write a script to do that.
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.