title: Convert BASH sed command for replacing strings in files to Powershell command
body: <p>I am trying to create a Power Shell script that is replacing one string with another in all folder and sub-folder files also to print all the paths the script went through. So I have written the Bash command but can't convert it to Powershell command</p>
  
  <p>Here is the bash command that is doing the job correctly</p>
  
  <pre><code>find ./ -print -type f -exec sed -i 's/string1/string2/g' {} \;
  </code></pre>
  
  <p>The closest I found was </p>
  
  <pre><code>ls * -rec | %{ $f=$_; (gc $f.PSPath) | %{ $_ -replace "string1", "string2" } | sc $f.PSPath }
  </code></pre>
  
  <p>But it looks like is not doing the job the same, plus it is not printing the path</p>