Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeRtf

Module
PSWriteOffice
Inputs
System.String[]
Outputs
OfficeIMO.Rtf.RtfDocument

Creates an RTF document, optionally with paragraphs from -Text or the pipeline.

Syntax

New-OfficeRtf
[-Force]
[[-Path] <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: Live
New-OfficeRtf
[-Force]
[-PassThru]
[-Path] <String>
[-Show]
[-Text] <String[]>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: Text
New-OfficeRtf
[-Content] <ScriptBlock>
[-Force]
[-PassThru]
[-Path] <String>
[-Show]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: Content

Examples

Use the native OfficeRtf command.

New-OfficeRtf -Path .\Note.rtf -Text 'Server maintenance starts at 22:00.'

Parameters

-Force SwitchParameter optional
Force for this operation.
-Path String required in Text, Contentposition: 0
Path for this operation.
-WhatIf SwitchParameter optional
Shows what would happen if the command runs.
-Confirm SwitchParameter optional
Prompts for confirmation before running the command.
-PassThru SwitchParameter optionalsets: Text, Content
PassThru for this operation.
-Show SwitchParameter optionalsets: Text, Content
Show for this operation.
-Text String[] requiredposition: 1pipeline: True (ByValue)sets: Text
Text for this operation.
-Content ScriptBlock requiredposition: 1sets: Content
Content for this operation.

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.