Skip to content

Instantly share code, notes, and snippets.

@musukvl
Created November 4, 2020 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save musukvl/e79d1fdf6054c6962c1f971a1b143a7f to your computer and use it in GitHub Desktop.
Save musukvl/e79d1fdf6054c6962c1f971a1b143a7f to your computer and use it in GitHub Desktop.
PowerShell: Replace text in multiple files
ls ./SqlScripts/*.sql | %{$f = $_; (gc $f.PSPath) | %{$_ -replace "SET @ENV = ''", "SET @ENV = 'TEST'"} | sc $f.PSPath }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment