Powershell change RTF Document and save as RTF Document Powershell change RTF Document and save as RTF Document powershell powershell

Powershell change RTF Document and save as RTF Document


Use the Get-Content cmdlet to load the file, do your replacements and finally write it back using the Set-Content cmdlet.

Example:

$filepath = 'Your_file_Path'$content = Get-Content $filepath -raw$content = $content -replace 'ReplaceMe', 'IReplacedYou'$content = $content -replace 'ReplaceMe2', 'IReplacedYou2'$content | Set-Content $filepath