title: Format a list that can contain other lists in Powershell
body: <p>I want to output a list can contain other lists in Powershell so that every list is displayed in a line of its own. I currently use <em>-property SyncRoot</em> but that gives empty lines and unnecessary words in the output.
  Sample code:</p>
  
  <pre><code>PS H:\&gt; $l = @(1,2)
  PS H:\&gt; $l += ,@(3,4,5)
  PS H:\&gt; $l += ,@(23,42)
  PS H:\&gt; format-list -inputobject $l -property SyncRoot
  1
  2
  
  SyncRoot : {3, 4, 5}
  
  SyncRoot : {23, 42}
  </code></pre>
  
  <p>But I want the output to look like this:</p>
  
  <pre><code>1
  2
  {3, 4, 5}
  {23, 42}
  </code></pre>