Hier mal als kleines Beispiel das Geburtstagserinnerung Script. Ist schon eine Weile her als ich das geschrieben habe. Würde ich heute wahrscheinlich anders lösen. 
Code:
function SendMail([string] $absender, $empfänger, $subject, $body)
{
$smtp = New-Object System.Net.Mail.SMTPClient –ArgumentList "mailserver"
$smtp.Send($absender, $empfänger, $subject, $body)
}
function compare_date([DateTime] $d1, $d2)
{
$d1 = $d1.AddDays(-2)
[int] $tag1 = $d1.day;
[int] $mon1 = $d1.month;
[int] $tag2 = $d2.day;
[int] $mon2 = $d2.month;
if(($tag1 -eq $tag2) -and ($mon1 -eq $mon2))
{
return $true
}
else
{
return $false
}
}
function get_app
{
$file = "Geburtstagsliste.csv"
#$file = "Birthday1.csv"
$logfile = "Log.txt"
$filepath ="\\Server\share\PowerShell\Geburtstags_Erinnerung"
$lines = Get-Content $filepath\$file
$heute = Get-Date
foreach($l in $lines)
{
$row = $l.split(";")
$name = $row[0]
$datum = $row[1]
$chef = $row[2]
$email = $row[3]
$anrede = $row[4]
$text = "Guten Tag $anrede $chef, am $datum hat $name Geburtstag.`nFreundliche Grüsse"
$dat = $([datetime]::ParseExact($datum, "dd.MM.yyyy", $null))
if(compare_date $dat $heute)
{
SendMail "from" $email "Geburtstags Erinnerung" $text
Add-Content -Path $filepath\$logfile -Value "$(get-date -Format d) Email an $email versendet für $name"
}
}
}
# MAIN
cls
get_app