First off let me state that I'm using Orchestrator to send the email through powershell. Unfortunately due to this constraint I can only write in Powershell v.1 code. I could call to an external powershell to help this matter but due to the other moving pieces I'm trying to keep it all in one place as much as possible. Think the below can be done?
I'm wanting to send a .htm file as html in the body of the e-mail. This .htm file is written to every day and sometimes contains no new data. I don't want the email to send if there's no added data so I'm measuring the size of the file. This is working however now if it's lower than specified file size it just sends a blank email. I rather it send no email if the file size requirement is not met.
Just a thought, why not put your send mail in a function. you could then test to see if the file is the correct size and then call the function and if it is not the correct size dont call the function.