title: Powershell RegEx Match Index is always the same
body: <p>I'm using the following code snippet to search for several system names in a text file and save them in an array.<br>
  Now, I need to save the position of the matches but just get always only the position of the first match.</p>
  
  <pre><code>$pattern_sysname = '(?&lt;=Computername).+?($)'
  Get-Content $path | Foreach {if ([Regex]::IsMatch($_, $pattern_sysname)) {
  
             $arr_sysname += [Regex]::Match($_, $pattern_sysname)
  
          }
  
              }
  
             $arr_sysname.index
  </code></pre>
  
  <p>I need the position of every single match.</p>