SyntaxFix
Write A Post
Hire A Developer
Questions
Alternative solution that won't append a spurious CR-LF:
$original_file ='C:\Users\abc\Desktop\File\abc.txt' $text = [IO.File]::ReadAllText($original_file) -replace "`r`n", "`n" [IO.File]::WriteAllText($original_file, $text)