title: Use Powershell to print out line number of code matching a RegEx
body: <p>I think we have a bunch of commented out code in our source, and rather than delete it immediately, we've just left it.  Now I would like to do some cleanup.</p>
  
  <p>So assuming that I have a good enough RegEx to find comments (the RegEx below is simple and I could expand on it based on our coding standards), how do I take the results of the file that I read up and output the following:</p>
  
  <ul>
  <li>Filename</li>
  <li>Line Number</li>
  <li>The actual line of code</li>
  </ul>
  
  <p>I think I have the basis of an answer here, but I don't know how to take the file that I've read up and parsed with RegEx and spit it out in this format.  </p>
  
  <p>I'm not looking for the perfect solution - I just want to find big blocks of commented out code.  By looking at the result and seeing a bunch of files with the same name and sequential line numbers, I should be able to do this.</p>
  
  <pre><code>$Location = "c:\codeishere"
  
  [regex]$Regex = "//.*;" #simple example - Will expand on this...
  
  $Files = get-ChildItem $Location -include *cs -recurse
  foreach ($File in $Files) {
      $contents = get-Content $File
      $Regex.Matches($contents) | WHAT GOES HERE?
  }
  </code></pre>