How can I reference a variable in a variable?

by Dec 20, 2010

My subject is probably not worded correctly. 


I am working on some scripts and using the "Send-MailMessage" command. I need to have some variables in the body of the message…. How can I do this? These variables are directories, log file locations, IP addresses, etc from the script. When the script finishes or fails I need to send an email with pertinent info about the job..



$bod = @"

Line 1 

Line 2 


Line 4



Send-MailMessage -To -Subject subject -From -body $bod -SmtpServer server