Skip to content

Instantly share code, notes, and snippets.

@csharpforevermore
Created February 28, 2014 00:23
Show Gist options
  • Save csharpforevermore/9262665 to your computer and use it in GitHub Desktop.
Save csharpforevermore/9262665 to your computer and use it in GitHub Desktop.
Open the text file test.txt and replace all occurrences of "foo" with "bar"
(Get-Content test.txt) | ForEach-Object { $_ -replace "foo", "bar" } | Set-Content test.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment