title: Editing a file using search string in powershell
body: <p>I am having difficulties in writing a powershell/batch script which needs to search a string in the input file, copy the content of line to next line and replace the string by another string.</p>
  
  <p>For example if my file has following content</p>
  
  <pre><code>James is awesome.
  
  Ryan is handsome.
  
  Henry is a bad boy.
  
  Jim is studious
  </code></pre>
  
  <p>And output should look like when script is called with inputs <code>"***Henry***"</code> &amp; <code>"***Glenn***"</code></p>
  
  <pre><code>James is awesome.
  
  Ryan is handsome.
  
  ***Henry*** is a bad boy.
  
  ***Glenn*** is a bad boy.
  
  Jim is studious
  </code></pre>