I have a report for Exchange Server Health that uses PowerShell and exports to a formatted HTML document, however the file to variable and email variable wont work with attachment. I can get the report by using BLART, however i cant send variables to blart for what i want to do after it is done.
AT the end of the day it all depends on why you are attaching the file to an email.
In a recent case for me I was just wanting it as part of ticket for my techs to look at, so I simply used the "Get File" function to transfer it back to the Kaseya server, and then included a link in my email to the get the file from the machines "Get file" repository using the following syntax
https://<url to my kaseya server>/ConfigTab/loadGetFile.asp?filename=<Filename>&theMachine=#vAgentConfiguration.agentGuid#
That may prove to be an acceptable solution for you provided that whomever would be reading the email has a login to your Kaseya instance.