API Reference
Cmdlet
ConvertFrom-OfficeWordMarkdown
Creates a Word document from Markdown.
Remarks
Returns a WordDocument or saves it to disk when -OutputPath is provided.
Examples
Example 1: Create a .docx from Markdown text.
PS>
ConvertFrom-OfficeWordMarkdown -Markdown '# Hello' -OutputPath .\hello.docx
Writes a Word document containing the supplied Markdown.
Example 2: Pipe a Markdown document into Word conversion.
PS>
Get-OfficeMarkdown -Path .\README.md | ConvertFrom-OfficeWordMarkdown
Returns a Word document instance for further edits.
Example 3: Insert Markdown into a Word template bookmark.
PS>
ConvertFrom-OfficeWordMarkdown -Path .\SOP.md -TemplatePath .\Template.docx -BookmarkName MainContent -OutputPath .\SOP.docx
Copies the template and replaces the bookmark paragraph with generated Markdown content.
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
ConvertFrom-OfficeWordMarkdown [-AllowDataUriImages <Nullable`1>] [-AllowedImageDirectory <String[]>] [-AllowLocalImages] [-AllowRemoteImages] [-BaseUri <String>] [-BookmarkName <String>] [-ContentControlAlias <String>] [-ContentControlTag <String>] [-FitImagesToContextWidth] [-FitImagesToPageContentWidth] [-FontFamily <String>] [-KeepPlaceholder] -Markdown <String> [-MaxDataUriImageBytes <Nullable`1>] [-MaxImageHeightPixels <Nullable`1>] [-MaxImageWidthPercentOfContent <Nullable`1>] [-MaxImageWidthPixels <Nullable`1>] [-NormalizeInput <Nullable`1>] [-Open] [-OutputPath <String>] [-PassThru] [-PreferNarrativeSingleLineDefinitions] [-Profile <Nullable`1>] [-ReaderOptions <MarkdownReaderOptions>] [-RenderFrontMatter] [-TemplatePath <String>] [-Theme <Nullable`1>] [<CommonParameters>]#Parameter set:
MarkdownParameters
- AllowDataUriImages Nullable`1
- 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 Nullable`1
- Maximum decoded size for one data URI image.
- MaxImageHeightPixels Nullable`1
- Optional hard cap for Markdown image height in pixels.
- MaxImageWidthPercentOfContent Nullable`1
- Optional hard cap for Markdown image width as a percentage of available content width.
- MaxImageWidthPixels Nullable`1
- Optional hard cap for Markdown image width in pixels.
- NormalizeInput Nullable`1
- Applies a built-in Markdown input normalization preset before parsing. Possible values: None, 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 Nullable`1
- 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 Nullable`1
- Shared Markdown visual theme for generated Word output. Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report
Outputs
OfficeIMO.Word.WordDocument, System.IO.FileInfo
ConvertFrom-OfficeWordMarkdown [-AllowDataUriImages <Nullable`1>] [-AllowedImageDirectory <String[]>] [-AllowLocalImages] [-AllowRemoteImages] [-BaseUri <String>] [-BookmarkName <String>] [-ContentControlAlias <String>] [-ContentControlTag <String>] -FilePath <String> [-FitImagesToContextWidth] [-FitImagesToPageContentWidth] [-FontFamily <String>] [-KeepPlaceholder] [-MaxDataUriImageBytes <Nullable`1>] [-MaxImageHeightPixels <Nullable`1>] [-MaxImageWidthPercentOfContent <Nullable`1>] [-MaxImageWidthPixels <Nullable`1>] [-NormalizeInput <Nullable`1>] [-Open] [-OutputPath <String>] [-PassThru] [-PreferNarrativeSingleLineDefinitions] [-Profile <Nullable`1>] [-ReaderOptions <MarkdownReaderOptions>] [-RenderFrontMatter] [-TemplatePath <String>] [-Theme <Nullable`1>] [<CommonParameters>]#Parameter set:
PathParameters
- AllowDataUriImages Nullable`1
- 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.
- FilePath String
- Path to a Markdown file.
- 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.
- MaxDataUriImageBytes Nullable`1
- Maximum decoded size for one data URI image.
- MaxImageHeightPixels Nullable`1
- Optional hard cap for Markdown image height in pixels.
- MaxImageWidthPercentOfContent Nullable`1
- Optional hard cap for Markdown image width as a percentage of available content width.
- MaxImageWidthPixels Nullable`1
- Optional hard cap for Markdown image width in pixels.
- NormalizeInput Nullable`1
- Applies a built-in Markdown input normalization preset before parsing. Possible values: None, 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 Nullable`1
- 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 Nullable`1
- Shared Markdown visual theme for generated Word output. Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report
Outputs
OfficeIMO.Word.WordDocument, System.IO.FileInfo
ConvertFrom-OfficeWordMarkdown [-AllowDataUriImages <Nullable`1>] [-AllowedImageDirectory <String[]>] [-AllowLocalImages] [-AllowRemoteImages] [-BaseUri <String>] [-BookmarkName <String>] [-ContentControlAlias <String>] [-ContentControlTag <String>] -Document <MarkdownDoc> [-FitImagesToContextWidth] [-FitImagesToPageContentWidth] [-FontFamily <String>] [-KeepPlaceholder] [-MaxDataUriImageBytes <Nullable`1>] [-MaxImageHeightPixels <Nullable`1>] [-MaxImageWidthPercentOfContent <Nullable`1>] [-MaxImageWidthPixels <Nullable`1>] [-NormalizeInput <Nullable`1>] [-Open] [-OutputPath <String>] [-PassThru] [-PreferNarrativeSingleLineDefinitions] [-Profile <Nullable`1>] [-ReaderOptions <MarkdownReaderOptions>] [-RenderFrontMatter] [-TemplatePath <String>] [-Theme <Nullable`1>] [<CommonParameters>]#Parameter set:
DocumentParameters
- AllowDataUriImages Nullable`1
- 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.
- Document MarkdownDoc
- Markdown document instance to convert.
- 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.
- MaxDataUriImageBytes Nullable`1
- Maximum decoded size for one data URI image.
- MaxImageHeightPixels Nullable`1
- Optional hard cap for Markdown image height in pixels.
- MaxImageWidthPercentOfContent Nullable`1
- Optional hard cap for Markdown image width as a percentage of available content width.
- MaxImageWidthPixels Nullable`1
- Optional hard cap for Markdown image width in pixels.
- NormalizeInput Nullable`1
- Applies a built-in Markdown input normalization preset before parsing. Possible values: None, 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 Nullable`1
- 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 Nullable`1
- Shared Markdown visual theme for generated Word output. Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report
Outputs
OfficeIMO.Word.WordDocument, System.IO.FileInfo