Cmdlet
ConvertTo-OfficeWordMarkdown
Converts a Word document to Markdown.
Syntax
ConvertTo-OfficeWordMarkdown
[-EnableHighlight]
[-EnableUnderline]
[-FontFamily <String>]
[-ImageDirectory <String>]
[-ImageExportMode <Base64| File>]
[-OutputPath <String>]
[-PassThru]
[-Path] <String>
[<CommonParameters>]#Parameter set:
PathConvertTo-OfficeWordMarkdown
-Document <WordDocument>
[-EnableHighlight]
[-EnableUnderline]
[-FontFamily <String>]
[-ImageDirectory <String>]
[-ImageExportMode <Base64| File>]
[-OutputPath <String>]
[-PassThru]
[<CommonParameters>]#Parameter set:
DocumentDescription
Returns Markdown text or saves it to a file when -OutputPath is specified.
Examples
Convert a .docx file to Markdown text.
$markdown = ConvertTo-OfficeWordMarkdown -Path .\report.docxLoads the document and returns Markdown markup.
Save Markdown to disk.
ConvertTo-OfficeWordMarkdown -Path .\report.docx -OutputPath .\report.md -PassThruWrites report.md and returns the file info.
Parameters
- -EnableHighlight SwitchParameter
- Wrap highlighted text with Markdown highlight markers.
- -EnableUnderline SwitchParameter
- Wrap underlined text with HTML underline tags.
- -FontFamily String
- Optional font family that should be treated as inline code.
- -ImageDirectory String
- Directory used when exporting images as files.
- -ImageExportMode ImageExportMode
- Controls how images are emitted during Markdown conversion.
- Possible values:
Base64,File - -OutputPath String
- Optional output path for the Markdown file.
- -PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- -Path String
- Path to a .docx file.
- -Document WordDocument
- Word 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.