Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeMarkdown

Module
PSWriteOffice
Inputs
None
Outputs
System.IO.FileInfo OfficeIMO.Markdown.MarkdownDocument

Creates a live Markdown document, or atomically publishes a completed content block.

Syntax

New-OfficeMarkdown
[-Force]
[[-Path] <String>]
[<CommonParameters>]
#
Parameter set: Live
New-OfficeMarkdown
[-AllowLoss]
[-Content] <ScriptBlock>
[-Force]
[-ImageRenderingMode <RichMarkdown|PortableMarkdown|Html>]
[-LineEnding <LF|CRLF|CR>]
[-PassThru]
[-Path] <String>
[-Show]
[-UnorderedListMarker <-|*|+>]
[-WriteOptions <MarkdownSaveOptions>]
[-WriteProfile <OfficeIMO|Portable|HtmlImage>]
[<CommonParameters>]
#
Parameter set: Content

Examples

Create a report in one block.

New-OfficeMarkdown -Path ./Report.md -PassThru { MarkdownHeading -Text 'Report' }

Compose a live document before saving.

$document = New-OfficeMarkdown -Path ./Report.md
$document | MarkdownHeading -Text 'Report'
$document | Save-OfficeMarkdown
$document | Close-OfficeMarkdown

Parameters

-Force SwitchParameter optional
Allow an existing destination; a failed block preserves its original contents.
-Path String required in Contentposition: 0aliases: FilePath
Optional associated destination for a live document; required when a content block saves a file.
-AllowLoss SwitchParameter optionalsets: Content
Explicitly accept reductions reported by the content block's native save.
-Content ScriptBlock requiredposition: 1sets: Content
Authoring block to complete before the document is atomically saved and closed.
-ImageRenderingMode MarkdownImageRenderingMode optionalsets: Content
Image serialization used when publishing a block.
Possible values: RichMarkdown, PortableMarkdown, Html
-LineEnding OfficeLineEnding optionalsets: Content
Line endings used when publishing a block.
Possible values: LF, CRLF, CR
-PassThru SwitchParameter optionalsets: Content
Return the saved FileInfo after a completed content block.
-Show SwitchParameter optionalsets: Content
Open the saved result in its registered application after the content block succeeds.
-UnorderedListMarker String optionalsets: Content
Unordered list marker used when publishing a block.
Possible values: -, *, +
-WriteOptions MarkdownSaveOptions optionalsets: Content
Native Markdown save settings or a hashtable, used when publishing a block.
-WriteProfile OfficeMarkdownWriteProfile optionalsets: Content
Writer profile used when publishing a block.
Possible values: OfficeIMO, Portable, HtmlImage

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.