title: Extract the last row of an array in Powershell
body: <p>I'm using Powershell to extract data via an API. For some reason, the output is providing multiple rows of data, however I'm only interested in the last row.</p>
  
  <p>How do I trim or filter the array so that it only shows me the row e.g. <code>{"preview":false...</code></p>
  
  <p>After I have the last row, I'm going to shift it into a hashtable using ConvertFrom-Json</p>
  
  <p>Any advice would be much appreciated!</p>
  
  <pre><code>$output
  {"preview":true,"offset":0,"lastrow":true,"result":{"TotalSuccess":"1152091","TotalUnsuccessful":"13759","Total":"1165850","Unsuccessful%":"6.80"}}
  {"preview":true,"offset":0,"lastrow":true,"result":{"TotalSuccess":"1204330","TotalUnsuccessful":"14265","Total":"1218595","Unsuccessful%":"6.76"}}
  {"preview":true,"offset":0,"lastrow":true,"result":{"TotalSuccess":"1233151","TotalUnsuccessful":"14500","Total":"1247651","Unsuccessful%":"6.75"}}
  {"preview":true,"offset":0,"lastrow":true,"result":{"TotalSuccess":"1249102","TotalUnsuccessful":"14714","Total":"1263816","Unsuccessful%":"6.76"}}
  {"preview":true,"offset":0,"lastrow":true,"result":{"TotalSuccess":"1262812","TotalUnsuccessful":"14794","Total":"1277606","Unsuccessful%":"6.73"}}
  {"preview":false,"offset":0,"lastrow":true,"result":{"TotalSuccess":"1271004","TotalUnsuccessful":"14873","Total":"1285877","Unsuccessful%":"6.73"}}
  </code></pre>