- Feb 23, 2005
- 3,100
- 149
- 116
...Are things I can automate.
New boss: "I need you to email me what days you've worked on-call."
Me: "I've always worked every other week. That's never changed since I started working here three years ago."
Boss: "I'd really like to get an email at the end of every on-call shift so I know."
Me: "Ok, I think I can do that..."
Set as bi-weekly job on a server I own.
Done.
Boss successfully automated.
New boss: "I need you to email me what days you've worked on-call."
Me: "I've always worked every other week. That's never changed since I started working here three years ago."
Boss: "I'd really like to get an email at the end of every on-call shift so I know."
Me: "Ok, I think I can do that..."
Code:
$startdate = (get-date).AddDays(-7).ToString('d')
$endDate = Get-Date -Format 'd'
$body = "Sketchmaster was on-call from $startdate to $enddate"
send-mailmessage -SmtpServer "workemail" -to "boss" -from "Sketchmaster" -subject "Sketchmaster on-call: $enddate" -Body $body
Set as bi-weekly job on a server I own.
Done.
Boss successfully automated.
Last edited: