title: Search a text file for specific word if found copy the entire line to new file in powershell
body: <p>I would like to search the string <code>failed</code> in a text file and if found copy the entire line to another file.</p>
  
  <p>Contends of test.txt: </p>
  
  <pre>
  : \Hardware\Disk Enclosure 27              diskslot1 failed  
  : \Hardware\Disk Enclosure 27              diskslot2 normal  
  : \Hardware\Disk Enclosure 27              diskslot3 normal 
  : \Hardware\Disk Enclosure 27              diskslot4 normal    
  </pre>
  
  <p>Please help on the script</p>