Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

New-OfficeRtf

Aliases: OfficeRtf, RtfNew
Module
PSWriteOffice
Aliases
OfficeRtf RtfNew
Inputs
System.String[]
Outputs
System.IO.FileInfo OfficeIMO.Rtf.RtfDocument

Creates an RTF document with plain paragraph content.

Syntax

New-OfficeRtf
[-NoSave]
[-PassThru]
[-Path] <String>
[[-Text] <String[]>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Create a small RTF file.

$file = New-OfficeRtf -Path .\Report.rtf -Text 'Summary', 'Ready for review' -PassThru
Get-OfficeRtf -Path $file.FullName

Creates an RTF document with two paragraphs and returns the file.

Parameters

-NoSave SwitchParameter optional
Return the OfficeIMO RTF document without saving.
-PassThru SwitchParameter optional
Emit a FileInfo for chaining.
-Path String requiredposition: 0aliases: FilePath, OutputPath
Destination path for the RTF file.
-Text String[] optionalposition: 1pipeline: True (ByValue)
Plain paragraph text to add to the document.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.