Hi all, I am new to Powershell so any help really appreciated.
I am trying to enter some event log errors to a single excel cell. I have no control of the layout of the spreadsheet so I am tied to achieving getting the results to a single cell. I am using the following command to get the required event log entries which works fine
$objlog = Get-WinEvent -FilterHashTable @{LogName = 'system'; Level=2; StartTime=(Get-Date).AddDays(-20)} -ErrorAction SilentlyContinue | select -unique Logname, message
This returns an array as is the case if I output to a file and then read the file using get-content. I have managed to get the contents in to single cell but the message within the entry is always delimited, leaving some text missing depending on what error was recorded in the event log, even after setting the max column width of 255 and autofit. Does anyone have any ideas on how to achieve this?
Thanks