I've created a powershell script along this line.
$ol=new-object -comobject outlook.application
$mail=$ol.createitem(0)
$mail.subject=(get-content $subject)
$mail.attachments.add($attachment)
$inspector=$mail.getinspector
$inspector.display()
But now I'm stuck on the following simple issue: How do I get focus on the newly created message? Sometimes it does appear in the foreground, but not always. How do I force it to the foreground?