Skip to content

Instantly share code, notes, and snippets.

@MartinMiles
Last active January 22, 2021 14:09
Show Gist options
  • Save MartinMiles/58b64ff62b880447099e82cd5415924c to your computer and use it in GitHub Desktop.
Save MartinMiles/58b64ff62b880447099e82cd5415924c to your computer and use it in GitHub Desktop.
One-liner recursively replace content in files
gci -r -include "*.yml","*.xml" | foreach-object { $a = $_.fullname; ( get-content $a -Encoding UTF8) | foreach-object { $_ -replace "FROM VALUE","TO VALUE" } | set-content $a -Encoding UTF8}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment