title: How do I add multi-line strings to an array in powershell?
body: <p>I'm trying to loop through a series of txt files extracting information into arrays based a : delimiter. </p>
  
  <p>All values i'm taking from the text files fit on a single line, except for one. (The "ad text" value). This cuts off the information after line 1 in the final output. When I remove line carriages and breaks beforehand, none of the fields are inputted correctly. </p>
  
  <p>How would I specify wanting my array to accept multi-line inputs for the "ad text" field? </p>
  
  <p>Below is the code i'm working with:</p>
  
  <pre><code>$files = ls "*.txt" 
  $dictionary = @{} 
  [System.Collections.Generic.List[String]]$list = @() 
  
  foreach($f in $files){$in = Get-Content $f
   $in.Split([Environment]::NewLine) | ForEach-Object { $key,$value = $_.Split(':') 
   $dictionary[$key] = $value 
   }
  
  [void]$list.Add( $dictionary['Ad ID'] + ',' + $dictionary['Ad Text'] + ',' + $dictionary['Ad Landing Page'] + ',' + $dictionary['Ad Targeting Location'] + ',' + $dictionary['Age'] + ',' + $dictionary['Language'] + ',' + $dictionary['Placements'] + ',' + $dictionary['Interests'] + ',' + $dictionary['Behaviors'] + ',' + $dictionary['Ad Impressions'] + ',' + $dictionary['Ad Clicks'] + ',' + $dictionary['Ad Spend'] + ',' + $dictionary['Ad Creation Date'] + ','+ $dictionary['Friends'] + ',' + $dictionary['Ad End Date'] + ',' + $dictionary['Excluded Connections'] + ',' + $dictionary['Image'] + ',' + $dictionary['Ad Targeting Location']+','+$dictionary[‘File Name’] ) 
  } 
  
  
  $list | Out-File -FilePath '.\trial.csv' -Append
  </code></pre>