Cmdlet
ConvertFrom-OfficeWordMarkdown
Creates a Word document from Markdown.
Syntax
ConvertFrom-OfficeWordMarkdown
[-AllowDataUriImages <Boolean>]
[-AllowedImageDirectory <String[]>]
[-AllowLocalImages]
[-AllowRemoteImages]
[-BaseUri <String>]
[-BookmarkName <String>]
[-ContentControlAlias <String>]
[-ContentControlTag <String>]
[-FitImagesToContextWidth]
[-FitImagesToPageContentWidth]
[-FontFamily <String>]
[-KeepPlaceholder]
[-Markdown] <String>
[-MaxDataUriImageBytes <Int64>]
[-MaxImageHeightPixels <Double>]
[-MaxImageWidthPercentOfContent <Double>]
[-MaxImageWidthPixels <Double>]
[-NormalizeInput <IntelligenceXTranscript| IntelligenceXTranscriptStrict| DocsLoose>]
[-Open]
[-OutputPath <String>]
[-PassThru]
[-PreferNarrativeSingleLineDefinitions]
[-Profile <OfficeIMO| CommonMark| GitHubFlavoredMarkdown| Portable>]
[-ReaderOptions <MarkdownReaderOptions>]
[-RenderFrontMatter]
[-TemplatePath <String>]
[-Theme <OfficeVisualThemeKind>]
[<CommonParameters>]#Parameter set:
MarkdownConvertFrom-OfficeWordMarkdown
[-AllowDataUriImages <Boolean>]
[-AllowedImageDirectory <String[]>]
[-AllowLocalImages]
[-AllowRemoteImages]
[-BaseUri <String>]
[-BookmarkName <String>]
[-ContentControlAlias <String>]
[-ContentControlTag <String>]
[-FitImagesToContextWidth]
[-FitImagesToPageContentWidth]
[-FontFamily <String>]
[-KeepPlaceholder]
[-MaxDataUriImageBytes <Int64>]
[-MaxImageHeightPixels <Double>]
[-MaxImageWidthPercentOfContent <Double>]
[-MaxImageWidthPixels <Double>]
[-NormalizeInput <IntelligenceXTranscript| IntelligenceXTranscriptStrict| DocsLoose>]
[-Open]
[-OutputPath <String>]
[-PassThru]
[-Path] <String>
[-PreferNarrativeSingleLineDefinitions]
[-Profile <OfficeIMO| CommonMark| GitHubFlavoredMarkdown| Portable>]
[-ReaderOptions <MarkdownReaderOptions>]
[-RenderFrontMatter]
[-TemplatePath <String>]
[-Theme <OfficeVisualThemeKind>]
[<CommonParameters>]#Parameter set:
PathConvertFrom-OfficeWordMarkdown
[-AllowDataUriImages <Boolean>]
[-AllowedImageDirectory <String[]>]
[-AllowLocalImages]
[-AllowRemoteImages]
[-BaseUri <String>]
[-BookmarkName <String>]
[-ContentControlAlias <String>]
[-ContentControlTag <String>]
-Document <MarkdownDoc>
[-FitImagesToContextWidth]
[-FitImagesToPageContentWidth]
[-FontFamily <String>]
[-KeepPlaceholder]
[-MaxDataUriImageBytes <Int64>]
[-MaxImageHeightPixels <Double>]
[-MaxImageWidthPercentOfContent <Double>]
[-MaxImageWidthPixels <Double>]
[-NormalizeInput <IntelligenceXTranscript| IntelligenceXTranscriptStrict| DocsLoose>]
[-Open]
[-OutputPath <String>]
[-PassThru]
[-PreferNarrativeSingleLineDefinitions]
[-Profile <OfficeIMO| CommonMark| GitHubFlavoredMarkdown| Portable>]
[-ReaderOptions <MarkdownReaderOptions>]
[-RenderFrontMatter]
[-TemplatePath <String>]
[-Theme <OfficeVisualThemeKind>]
[<CommonParameters>]#Parameter set:
DocumentDescription
Returns a WordDocument or saves it to disk when -OutputPath is provided.
Examples
Create a .docx from Markdown text.
ConvertFrom-OfficeWordMarkdown -Markdown '# Hello' -OutputPath .\hello.docxWrites a Word document containing the supplied Markdown.
Pipe a Markdown document into Word conversion.
Get-OfficeMarkdown -Path .\README.md | ConvertFrom-OfficeWordMarkdownReturns a Word document instance for further edits.
Insert Markdown into a Word template bookmark.
ConvertFrom-OfficeWordMarkdown -Path .\SOP.md -TemplatePath .\Template.docx -BookmarkName MainContent -OutputPath .\SOP.docxCopies the template and replaces the bookmark paragraph with generated Markdown content.
Parameters
- -AllowDataUriImages Boolean
- Allow data URI Markdown images to be embedded in Word output.
- -AllowedImageDirectory String[]
- Restrict local images to one or more directories.
- -AllowLocalImages SwitchParameter
- Allow local Markdown images to be inserted into the document.
- -AllowRemoteImages SwitchParameter
- Allow remote HTTP(S) images to be downloaded and inserted.
- -BaseUri String
- Base URI used to resolve relative links and images.
- -BookmarkName String
- Bookmark name that marks where Markdown content should be inserted in the template.
- -ContentControlAlias String
- Block content control alias that marks where Markdown content should be inserted in the template.
- -ContentControlTag String
- Block content control tag that marks where Markdown content should be inserted in the template.
- -FitImagesToContextWidth SwitchParameter
- Fit Markdown images to the current content context width.
- -FitImagesToPageContentWidth SwitchParameter
- Fit Markdown images to the page content width.
- -FontFamily String
- Optional font family applied during conversion.
- -KeepPlaceholder SwitchParameter
- Keep the target bookmark or content-control placeholder after inserting Markdown content.
- -Markdown String
- Markdown text to convert.
- -MaxDataUriImageBytes Int64
- Maximum decoded size for one data URI image.
- -MaxImageHeightPixels Double
- Optional hard cap for Markdown image height in pixels.
- -MaxImageWidthPercentOfContent Double
- Optional hard cap for Markdown image width as a percentage of available content width.
- -MaxImageWidthPixels Double
- Optional hard cap for Markdown image width in pixels.
- -NormalizeInput MarkdownInputNormalizationPreset
- Applies a built-in Markdown input normalization preset before parsing.
- Possible values:
IntelligenceXTranscript,IntelligenceXTranscriptStrict,DocsLoose - -Open SwitchParameter
- Open the document after saving.
- -OutputPath String
- Optional output path for the .docx file.
- -PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- -PreferNarrativeSingleLineDefinitions SwitchParameter
- Prefer narrative paragraphs for isolated single-line definition-list patterns.
- -Profile MarkdownDialectProfile
- Named Markdown reader profile used when ReaderOptions is not supplied.
- Possible values:
OfficeIMO,CommonMark,GitHubFlavoredMarkdown,Portable - -ReaderOptions MarkdownReaderOptions
- Optional Markdown reader options used before Word conversion.
- -RenderFrontMatter SwitchParameter
- Render YAML front matter as visible Word content. Template conversions hide front matter by default.
- -TemplatePath String
- Optional Word template document to copy before inserting Markdown content.
- -Theme OfficeVisualThemeKind
- Shared Markdown visual theme for generated Word output.
- Possible values:
Plain,WordLike,TechnicalDocument,GitHubLike,Compact,Report - -Path String
- Path to a Markdown file.
- -Document MarkdownDoc
- Markdown document instance to convert.
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.