title: powershell sort json by value with Sort-Object
body: <p>I have a JSON file with an array as value and I would like to sort the array be value.</p>
  
  <p>test.json</p>
  
  <pre><code>{
      "user_name" : "paul",
      "cars" : 
      [
          {
              "name" : "BMW"
          },
          {
              "name" : "VW"
          },              
          {
              "name" : "Audi"
          }
      ]
  }
  </code></pre>
  
  <p>My powershell command</p>
  
  <pre><code>Get-Content .\test.json | ConvertFrom-Json | Sort-Object -Property @{expression={$_.cars.name};Descending=$true} | ConvertTo-Json
  {
      "user_name":  "paul",
      "cars":  [
                   {
                       "name":  "BMW"
                   },
                   {
                       "name":  "VW"
                   },
                   {
                       "name":  "Audi"
                   }
               ]
  }
  </code></pre>
  
  <p>How can I sort the array "cars" to get the correct order "Audi", "BMW", "VW"?</p>