API Reference

Cmdlet

New-OfficeRtf

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

Creates an RTF document with plain paragraph content.

Remarks

Creates an RTF document with plain paragraph content.

Examples

Authored help example

Create a small RTF file.

PS>


$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.

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.

Syntax

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

Parameters

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

Outputs

System.IO.FileInfo OfficeIMO.Rtf.RtfDocument