We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!
When you echo out $test, it comes out just fine but when it is used in the below command i get an error (both are below). How can I get a multi-line variable (aka Here-String) to write to the event log?
$test = @" Test ~~~~ TEst. "@
Write-EventLog –LogName "Application" –Source "test" –EntryType "Error" –EventID 1 –Message $test
At C:\Scripts\test.ps1:9 char:112
+ ... â€“EventID 1 â€“Message $test
The string is missing the terminator: ".
+ CategoryInfo : ParserError: (:) , ParseException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfS
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.