title: Powershell select-string: get search success boolean and file paths
body: <p>Following on <a href="https://stackoverflow.com/questions/1499575/output-filename-not-string-with-select-string">this question</a> on Powershell's <code>select-string</code>, I'm wondering how in the following pipeline, you can extract multiple return values from various parts of the pipeline. </p>
  
  <pre><code>Get-ChildItem "*.*" | Where-Object {$_.Name -match 'someMatchingCriteria.*'} | select-string -pattern 'someInterestingString' | Select-Object -Unique Path
  </code></pre>
  
  <p>Specifically, I'd like to know how to get a boolean from the <code>select-string</code> telling whether anything was actually found or not, as well as any files paths that were found to contain the search string so that I can then do an if statement to either stop and announce which files were found to contain the string, or continue without printing anything. </p>
  
  <p>If I just put a <code>$test=</code> out front of that line, it returns the path inside inside a <code>@{ }</code>, but I think the select-string by itself will generate a boolean if you use <code>-quiet</code>.</p>