I am using a standard SendMessage command to send an email in a PowerShell script. I want to attach a log file but unfortunatly the log file is locked by a parent script.
Is there a way to send the file anyways as an attachment (I don't want to delete it or write it)?
I know I can read the file with Get-Content
, should I pipe this output to a new temporary file that is then attached? If that would work how would I go about doing this.