Replace / Remove
Replace Strings
type C:\file.txt | powershell -Command "$input | % { $_ -replace 'oldtext', 'newtext' }" > C:\modifiedfile.txt(Get-Content C:\path\to\file.txt) -replace 'oldString', 'newString' | Set-Content C:\path\to\modifiedfile.txtRemove Strings
Remove Lines
Remove Whitespace
Get-Content C:\file.txt | ForEach-Object { $_.Trim() } | Set-Content C:\trimmedfile.txtLast updated