title: Powershell turn strings into array with headings
body: <p>I'd like to create a table with headings from a series of strings, which have been pulled from an output. I've already used this...</p>
  
  <pre><code>$Scopearray = @("$server","$ip","$ScopeName","$Comment")
  </code></pre>
  
  <p>To turn this... </p>
  
  <pre><code>$ip = $Trimmed[0]
  $server = $Trimmed[1]
  $ScopeName = $Trimmed[2]
  $Comment = $Trimmed[3]
  </code></pre>
  
  <p>Into this:</p>
  
  <blockquote>
  <pre><code>PS C:\WINDOWS\system32&gt; $Scopearray 
  MyServer.domain
  10.1.1.1
  NameofScope
  ScopeDetails
  </code></pre>
  </blockquote>
  
  <p>But I need to turn that into a table, something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/uExsp.png" alt="Table Example"></p>
  
  <p>I've tried the below, and a copule of other multidimentional examples, but I'm clearly missing something fundamental. </p>
  
  <pre><code>$table = @()
  foreach ($instance in $Scopearray) {
  $row = "" | Select ServerName,IP,ScopeName,Comment
  $row.Heading1 = "Server Name"
  $row.Heading2 = "IP Address"
  $row.Heading3 = "Scope Name"
  $row.Heading4 = "Comment"
  $table += $row
  }
  </code></pre>