title: Searching for all TFS changesets based on a check-in Comment
body: <p>Is there a way to search TFS using PowerShell to find all changesets that contain some sub-string in the check-in comment? I'd like to see the individual files in all the changesets in one view. In my case I am searching for all changesets that contain a defect number e.g. 'D-12345'.</p>
  
  <p>I tried the example as outlined <a href="https://stackoverflow.com/a/960724/787157">here</a>. But running ...</p>
  
  <pre><code>tf history $/MyCodeRepo/Trunk -r /noprompt /format:detailed | ? { $_.comment -like *D-12345* }
  </code></pre>
  
  <p>... gives me several errors:</p>
  
  <ul>
  <li>You must provide a value expression on the right-hand side of the
  '-like' operator. </li>
  <li>You must provide a value expression on the
  right-hand side of the '*' operator. </li>
  <li>Unexpected token 'D-12345*' in
  expression or statement.</li>
  </ul>
  
  <p>I then tried putting quotes around the search string but that just returned no results.</p>
  
  <p>I have TFS power tools installed and I know you can use searchcs to search by Comment but you have to open each changeset individually. </p>
  
  <p>Any ideas how I can do this?</p>
  
  <p>Thanks,</p>