Hi everyone! I'm trying to insert an em dash in the body of an HTML email using the Send-MailMessage command in PowerShell. I've defined the em dash as follows: $emDash = [char]0x2014. However, when I use it in my line like this: you're all set$emDashno action is needed, the "no" ends up being attached to the em dash. Can someone help me figure out how to prevent this from happening? If it helps, I've included a picture for better context: [https://imgur.com/a/gLiXyPS]. Thanks a lot!
1 Answer
To avoid having the "no" attach to the em dash, you should use curly braces to delineate the variable. You'd write it like this: `you're all set ${emDash}no action is needed.` This tells PowerShell where the variable ends and the text begins.
Got it! I'll keep that in mind for my future scripts. I also tried using — inline, and that worked too.