Hi,
Good Evening everyone.
In my previous posts we have created new, contacts, calendar meeting using Powershell and now it is time to create outlook tasks using Powershell.
I have converted all functions to the module and you can download the module from my Github repository.
“OutlookTools” Module download link: https://github.com/AmanDhally/OutlookTools
Let’s start
- First download the “OutlooTools.Psm1” and .psd1 file fromhttps://github.com/AmanDhally/OutlookTools
- Create a folder Name “OutlookTools” in “Libraries\Documents\WindowsPowershell\Modules”
- and paste both files there.
Now open Powershell console and run the cmdlet,
Import-Module OutlookTools |
By running the Get-Command cmdlet, we can see which cmdlet and function this modules had added.
Get-Command -Module outlooktools |
You can see a new cmdlet New-OutlookTask (basically function is there).
Like previous functions the New-OutlookTask is based on Outlook.Application com object too. While writing this module i was wondering that how amazing and simple Powershell is.
I think one day, i will write a post about how awesome Powershell is ;o).
Okey, Our Module is imported and now lets see some examples of creating a Outlook tasks using our New-OutlookTask function in OutlookTools Module.
Example : 1
Lets create a simplest task, with just a subject using the –Subject Parameter,
New-OutlookTask -Subject "Going to visit Alice in wonderland" |
and you can see that task name “Going to visit Alice in Wonderland” appeared in the Outlook task list.
Example: 2
Lets create a task with some extra notes using parameter -Notes
New-OutlookTask -Subject "Visit Captain Jack Sparrow" -Notes " He lives near Caribbean" |
You can see that , task is appeared in the Outlook and it has the note which we defined using –Notes parameter.
Example: 3
Let’s create a task with high importance and with a specific start date.
New-OutlookTask -Subject "Metting with Mr. Harrry Potter" -Importance 2 -StartDate "08/15/2013 19:00 " |
You can see that. this task has the start date and High Priority and mentioned in above function.
Example: 4
Lets create a simple task with no reminders.
New-OutlookTask -Subject "Meeting with Tony" -Notes "ask him about Startreak" -EnableReminder $false |
You can see that in this task, there is no reminder is set.
Example: 5
Lets create a final task with start date, due date and with reminder set.
New-OutlookTask -Subject "Search for Avengers" -Notes "I goona find them" -Importance 2 -StartDate "08/15/2013"-DueDate "08/19/2013" -ReminderTime "08/17/2013 10:30" |
You can see that , everything is set :) .
I hope you will enjoy it.
“OutlookTools” Module download link: https://github.com/AmanDhally/OutlookTools
I hope you will like it :)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.