title: powershell sort multidimensional array
body: <p>I am a newbie in Powershell, but this is driving me a bit crazy. I have looked at various questions here, but could not find an answer so here I go. Apologies if this has been covered already.</p>
  
  <p>I have two text files containing columns of numbers. I would like to create an array containing those 2 columns and sort it by column 1 or 2.</p>
  
  <p>If we had</p>
  
  <pre><code>$a=@(1,5,10,15,25)
  $b=@(100,99,98,99,10)
  </code></pre>
  
  <p>we create</p>
  
  <pre><code>c$=$a,$b
  </code></pre>
  
  <p>My initial thought was to try something like this:</p>
  
  <pre><code>$c | sort { [int]$_[0] }
  </code></pre>
  
  <p>But it does not work. I have tried many different things so any advice would be appreciated.</p>
  
  <p>I am editing this as my question was not so clear. Ultimately, if I sort $c by ascending column 2, I expect something like:</p>
  
  <pre><code>25,10
  10,98
  5,99
  15,99
  1,100
  </code></pre>
  
  <p>Any idea how to achieve this ?</p>