title: Powershell: how to convert system.object values to Array values
body: <pre><code>$t3 = Get-Nabc | % { $_.name }
  Write-Host $t3.name
  Write-Host $t3.gettype()
  </code></pre>
  
  <p>The output is</p>
  
  <pre><code>A B C D E F G H I J 
  System.Object[]
  </code></pre>
  
  <p>Question:-  I would like to get the output to array and compare with a string</p>
  
  <pre><code>$t3 = Get-Nabc | % { $_.name }
  $a1 = $t3
  
  for ($i=0; $i -le $t3.length; $i++) {
      if('A' -in $a1[0]) {
          Write-Host 'Match'
      }
      else {
          Write-Host 'Not Match'
      }
  }
  </code></pre>
  
  <p>But the code is not working. how to convert/copy the values from system.object to array?</p>