title: PS: Get index in an array list
body: <p>I have an array of strings. Not sure if there is simple way to get the index of an item first found in the array?</p>
  
  <pre><code># example array
  $array = "A", "B", "C"
  $item = "B"
  # the following line gets null, any way to get its index?
  $index = $array | where {$_ -eq $item} | ForEach-Object { $_.Index }
  </code></pre>
  
  <p>I could do it in a loop. not sure if there is any alternative way?</p>