title: How to add different string lines to a new column and each row in a csv?
body: <p><a href="https://i.stack.imgur.com/2v4UX.png" rel="nofollow noreferrer">Image of the error log</a>
  i want to get the "Messages:" (in the Generals tab) line to the "CCIS_Error_Log_2017-05-03.csv" in a new column each row mapping the corresponding event. </p>
  
  <pre><code>(Get-WinEvent -FilterHashTable @{logname = 'CCIS'; } | where {$_.LevelDisplayName -eq "Error"}|select Message)|Set-Content -Path "C:\Logs\temp.txt"
  
  Import-Csv C:\CCIS_Error_Log_2017-05-03.csv|select-object *,@{Name="Messages";Expression={select-string C:\Logs\temp.txt -pattern "Message:" | foreach {$_.Line}}} | Export-Csv C:\Logs\CCIS_Error_Log_2017-05-03.csv -notypeinformation
  </code></pre>
  
  <p>This is a segment of the script i wrote to do the above scenario. but instead mapping to the event it copies all the "Messages:" in each event to a single row in the csv file.</p>
  
  <p>I hope i explained it well
  Thanks in advance</p>