title: PowerShell foreach how to skip last element
body: <p>I have the follow array with the elements  </p>
  
  <pre><code>$list = "A","B","C","1","2","3"
  </code></pre>
  
  <p>using foreach I can view all items in the array. </p>
  
  <pre><code>foreach ( $item in $list ) { $item }
  </code></pre>
  
  <p>I would like to print all elements in the array but the last one. As I need to add <code>;</code> at the end. </p>
  
  <p>How can I go about doing this? </p>