Adding tasks from Powershell
selan says:
If you do any work on Windows servers, you probably have used Powershell. Here is a simple Powershell function that will allow you to easily add tasks to RTM from the command line.
Add this function to your Powershell profile, substituting the appropriate values for your email.
function rtm($smartadd) {
Send-MailMessage -from %your-from-email% -to %your-rtm-email%@rmilk.com -subject "$smartadd" -smtpserver %your-email-server%
}
You can then call the rtm function from the Powershell command line. It takes one parameter, which is the Smart Add description of your task, in double quotes.
For example,
> rtm "Post my RTM tips and tricks !1 ^tomorrow"
Add this function to your Powershell profile, substituting the appropriate values for your email.
function rtm($smartadd) {
Send-MailMessage -from %your-from-email% -to %your-rtm-email%@rmilk.com -subject "$smartadd" -smtpserver %your-email-server%
}
You can then call the rtm function from the Powershell command line. It takes one parameter, which is the Smart Add description of your task, in double quotes.
For example,
> rtm "Post my RTM tips and tricks !1 ^tomorrow"
axehandle says:
I've recently ended up managing a bunch of Windows Server boxes, but I don't know PowerShell yet. How do I set my SMTP or mail server credentials?
martinvilange says:
@selan: That's very helpfull. Thank you.
@axehandle: Look at http://blogs.msdn.com/b/rkramesh/archive/2012/03/16/sending-email-using-powershell-script.aspx
@axehandle: Look at http://blogs.msdn.com/b/rkramesh/archive/2012/03/16/sending-email-using-powershell-script.aspx
emily (Remember The Milk) says:
Hi selan,
Thanks for sharing this -- you're this week's Tips & Tricks Tuesday winner. :) We've upgraded your Remember The Milk account with a year of Pro.
Thanks for sharing this -- you're this week's Tips & Tricks Tuesday winner. :) We've upgraded your Remember The Milk account with a year of Pro.
Log in
to post a reply.