Posted By

danfsmith on 07/19/11


Tagged

html replace


Versions (?)

Replace Content in HTML Files in a Folder


 / Published in: Windows PowerShell
 

  1. $Path = "C:\Path\"
  2. $HtmlFiles = Get-ChildItem $Path -Filter *.* -Recurse
  3. foreach ($file in $HtmlFiles) {
  4. Write-Host "Examining" $file
  5. (Get-Content $file.FullName) | Foreach-Object {$_\3 -replace "REPLACEME", "NEWCONTENT"} | Set-Content $file.FullName
  6. }

Report this snippet  

You need to login to post a comment.