title: How to remove some words from all text file in a folder by powershell?
body: <p>I have a situation that I need to remove some words from all text file in a folder.
  I know how to do that only in 1 file, but I need to do it automatically for all text files in that folder. I got no idea at all how to do it in powershell.
  The name of the files are random.</p>
  
  <p>Please help.</p>
  
  <p>This is the code </p>
  
  <hr>
  
  <p>$txt = get-content c:\work\test\01.i</p>
  
  <p>$txt[0] = $txt[0] -replace '-'</p>
  
  <p>$txt[$txt.length - 1 ] = $txt[$txt.length - 1 ] -replace '-'</p>
  
  <p>$txt | set-content c:\work\test\01.i</p>
  
  <hr>
  
  <p>Basicly it jsut removes a "-" from first line and last line, but i need to do this on all files in the folder. </p>