Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Cmdlet

New-OfficeMarkdown

Aliases: MarkdownNew
Namespace PSWriteOffice
Aliases
MarkdownNew
Inputs
None
Outputs
System.IO.FileInfo OfficeIMO.Markdown.MarkdownDoc

Creates a Markdown document using a DSL scriptblock.

Remarks

Runs the scriptblock against a Markdown document and saves it to disk unless -NoSave is specified.

Examples

Authored help example

Create a Markdown document with headings and a table.

PS>


New-OfficeMarkdown -Path .\README.md { MarkdownHeading -Level 1 -Text 'Report'; MarkdownTable -InputObject $data }
        

Creates a README file with a heading and table content.

Create a report with multiple tables.

PS>


New-OfficeMarkdown -Path .\Report.md {
                MarkdownHeading -Level 1 -Text 'Summary'
                MarkdownTable -InputObject $summary
                MarkdownHeading -Level 2 -Text 'Details'
                MarkdownTable -InputObject $details
              }
        

Creates a report with two tables separated by headings.

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-OfficeMarkdown [-Content <ScriptBlock>] [-ImageRenderingMode <RichMarkdown|PortableMarkdown|Html>] [-LineEnding <String>] [-MarkdownPdfOptions <MarkdownPdfSaveOptions>] [-NoSave] -OutputPath <String> [-PassThru] [-PdfApplyWordLikeTheme <Boolean>] [-PdfAuthor <String>] [-PdfBaseDirectory <String>] [-PdfConversionReportVariable <String>] [-PdfCreateOutlineFromHeadings <Boolean>] [-PdfDefaultImageHeight <Double>] [-PdfDefaultImageWidth <Double>] [-PdfFontFamily <String>] [-PdfFrontMatterRenderMode <Hidden|DocumentHeader|Table>] [-PdfIncludeDataUriImages <Boolean>] [-PdfIncludeLocalImages <Boolean>] [-PdfKeywords <String>] [-PdfMaximumDataUriImageBytes <Int32>] [-PdfOptions <PdfOptions>] [-PdfPath <String>] [-PdfRestrictLocalImagesToBaseDirectory <Boolean>] [-PdfSubject <String>] [-PdfTheme <Plain>] [-PdfTitle <String>] [-PdfUseFirstHeadingAsTitle <Boolean>] [-PdfUseFrontMatterMetadata <Boolean>] [-PdfUseFrontMatterVisualTheme <Boolean>] [-PdfWarningVariable <String>] [-UnorderedListMarker <String>] [-WriteOptions <MarkdownWriteOptions>] [-WriteProfile <OfficeIMO|Portable|HtmlImage>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Content ScriptBlock optionalposition: 1pipeline: False
DSL scriptblock describing Markdown content.
ImageRenderingMode MarkdownImageRenderingMode optionalposition: namedpipeline: Falsevalues: 3
Controls how Markdown images are serialized.
Possible values: RichMarkdown, PortableMarkdown, Html
LineEnding String optionalposition: namedpipeline: False
Markdown line ending: CRLF, LF, CR, or a literal line ending string.
MarkdownPdfOptions MarkdownPdfSaveOptions optionalposition: namedpipeline: False
Advanced Markdown PDF options. Friendly PDF parameters override matching values.
NoSave SwitchParameter optionalposition: namedpipeline: False
Skip saving after executing the DSL.
OutputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Destination path for the Markdown file.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo for chaining.
PdfApplyWordLikeTheme Boolean optionalposition: namedpipeline: False
Apply the built-in Word-like Markdown PDF baseline theme.
PdfAuthor String optionalposition: namedpipeline: False
PDF author metadata.
PdfBaseDirectory String optionalposition: namedpipeline: False
Base directory used to resolve local Markdown images during PDF export.
PdfConversionReportVariable String optionalposition: namedpipeline: False
Variable name that receives the Markdown PDF conversion report.
PdfCreateOutlineFromHeadings Boolean optionalposition: namedpipeline: False
Create PDF outlines from Markdown headings.
PdfDefaultImageHeight Double optionalposition: namedpipeline: False
Fallback PDF image height in points.
PdfDefaultImageWidth Double optionalposition: namedpipeline: False
Fallback PDF image width in points.
PdfFontFamily String optionalposition: namedpipeline: False
Default font family used by Markdown PDF export.
PdfFrontMatterRenderMode MarkdownPdfFrontMatterRenderMode optionalposition: namedpipeline: Falsevalues: 3
Controls how YAML front matter appears in the PDF body.
Possible values: Hidden, DocumentHeader, Table
PdfIncludeDataUriImages Boolean optionalposition: namedpipeline: False
Embed supported data URI images in Markdown PDF output.
PdfIncludeLocalImages Boolean optionalposition: namedpipeline: False
Embed supported local image files in Markdown PDF output.
PdfKeywords String optionalposition: namedpipeline: False
PDF keywords metadata.
PdfMaximumDataUriImageBytes Int32 optionalposition: namedpipeline: False
Maximum decoded bytes for one data URI image in Markdown PDF output.
PdfOptions PdfOptions optionalposition: namedpipeline: False
Underlying OfficeIMO.Pdf options used by Markdown PDF export.
PdfPath String optionalposition: namedpipeline: False
Optional PDF path to create from the same Markdown document.
PdfRestrictLocalImagesToBaseDirectory Boolean optionalposition: namedpipeline: False
Require local images to resolve under the base directory.
PdfSubject String optionalposition: namedpipeline: False
PDF subject metadata.
PdfTheme OfficeVisualThemeKind optionalposition: namedpipeline: Falsevalues: 6
Built-in Markdown PDF visual theme.
Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report
PdfTitle String optionalposition: namedpipeline: False
PDF title metadata.
PdfUseFirstHeadingAsTitle Boolean optionalposition: namedpipeline: False
Use the first Markdown heading as the PDF title when no title is supplied.
PdfUseFrontMatterMetadata Boolean optionalposition: namedpipeline: False
Use front matter values as PDF metadata.
PdfUseFrontMatterVisualTheme Boolean optionalposition: namedpipeline: False
Use front matter values to select a visual theme.
PdfWarningVariable String optionalposition: namedpipeline: False
Variable name that receives Markdown PDF export warnings.
UnorderedListMarker String optionalposition: namedpipeline: False
Unordered list marker: '-', '*', or '+'.
WriteOptions MarkdownWriteOptions optionalposition: namedpipeline: False
Optional Markdown writer options.
WriteProfile OfficeMarkdownWriteProfile optionalposition: namedpipeline: Falsevalues: 3
Friendly Markdown writer profile.
Possible values: OfficeIMO, Portable, HtmlImage

Outputs

System.IO.FileInfo, OfficeIMO.Markdown.MarkdownDoc