title: Delete extra columns of table before exporting to Excel
body: <p>I have a PowerShell script that runs a few API request and then export information on the test into an excel. </p>
  
  <p>When I create the table to I adds couple column for the results. However when I export the tables via Excel there are a bunch of extra column I don't want.</p>
  
  <pre class="lang-cs prettyprint-override"><code>$ResultsTable = New-Object System.Data.DataTable "ResultsTable"
  
  $RTC1 = New-Object system.Data.DataColumn "Type",([string])
  $RTC2 = New-Object system.Data.DataColumn "Endpoint",([string])
  $RTC3 = New-Object system.Data.DataColumn "PassRate",([string])
  $RTC4 = New-Object system.Data.DataColumn "AvgTime",([string])
  $RTC5 = New-Object system.Data.DataColumn "MaxTime",([string])
  $RTC6 = New-Object system.Data.DataColumn "AvgSize",([string])
  $RTC7 = New-Object system.Data.DataColumn "MaxSize",([string])
  
  $ResultsTable.Columns.Add($RTC1)
  $ResultsTable.Columns.Add($RTC2)
  $ResultsTable.Columns.Add($RTC3)
  $ResultsTable.Columns.Add($RTC4)
  $ResultsTable.Columns.Add($RTC5)
  $ResultsTable.Columns.Add($RTC6)
  $ResultsTable.Columns.Add($RTC7)
  
  $Row = $ResultsTable.NewRow()
  $Row.Type = "Direct"
  $Row.Endpoint = $Uri
  $Row.PassRate = "$PassRate%"
  $Row.AvgTime = $AvgTime
  $Row.MaxTime = $MaxTime
  $Row.AvgSize = $AvgSize
  $Row.MaxTime = $MaxSize
  $ResultsTable.Rows.Add($Row)
  
  $ResultsTable | Export-Excel -Path ".\Output\Unit\API.Customer.Unit.Tests - $DateTime.xlsx" `
      -AutoSize `
      -WorksheetName "Results" `
      -Title "Results Table" `
      -TitleBold `
      -BoldTopRow `
      -FreezeTopRow
  </code></pre>
  
  <p>The output of this export looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/V3AvQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V3AvQ.png" alt="enter image description here"></a></p>
  
  <p>I only need the Columns A - G. How do I get rid of the other columns?</p>