title: Find and replace in files fails
body: <p>I am trying to do find and replace in a file using following approach.</p>
  
  <pre><code>Function Find-Replace ($FileFullpath, $FindString, $ReplacementString) {
  
     Get-Content $FileFullpath | 
     Foreach-Object {$_ -replace $FindString, $ReplacementString } |  
     Set-Content $FileFullpath
  
  }
  
  Find-Replace "c:\program files (x86)\MyProj\web.config" $OldServiceName $NewServiceName
  </code></pre>
  
  <p>But i am always getting error.</p>
  
  <blockquote>
    <p>Set-Content : The process cannot access the file 'c:\program files
    (x86)\MyProj\web.config' because it is being used by another process.</p>
  </blockquote>
  
  <p>The file is not opened any where. I think Get-content is yet to release the file.</p>
  
  <p>Why it happens ? How to do find and replace in the same file without issue?</p>