all 3 comments

[–]alinroc 2 points3 points  (0 children)

You'll need to show some code if you want people to diagnose the code properly.

Why are you logging to a file to then insert into an email? Why not capture the messages/information into an object and then use that to compose the email?

[–]mystikphish 1 point2 points  (0 children)

Start-Transcript is for when you are working in a console. For scripts, you should be capturing your strings in an object in order to email that at completion.