Whether you need to trade-up to a shiny new Firebox or just ready to upgrade from whatever appliance you're using now, WatchGuard has the right appliance for you! Find your perfect Firebox today with appliance sizing tool!
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.