วันอังคารที่ 9 มิถุนายน พ.ศ. 2558

Replace string in files using Windows PowerShell

1. Run > Windows Power Shell
2. Place scripts as >> (Get-Content C:\Scripts\Test.txt) |
Foreach-Object {$_ -replace "\*", "@"} |
Set-Content C:\Scripts\Test.txt

This will replace * by @

Ref: http://stackoverflow.com/questions/60034/how-can-you-find-and-replace-text-in-a-file-using-the-windows-command-line-envir

http://blogs.technet.com/b/heyscriptingguy/