API Reference
Command
ConvertTo-OfficeWordMarkdown
Converts a Word document to Markdown.
Remarks
Converts a Word document to Markdown.
Examples
Convert a .docx file to Markdown text.
PS>$markdown = ConvertTo-OfficeWordMarkdown -Path .\report.docx
Loads the document and returns Markdown markup.
Save Markdown to disk.
PS>ConvertTo-OfficeWordMarkdown -Path .\report.docx -OutputPath .\report.md -PassThru
Writes report.md and returns the file info.
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
ConvertTo-OfficeWordMarkdown [-EnableHighlight] [-EnableUnderline] -FilePath <String> [-FontFamily <String>] [-ImageDirectory <String>] [-ImageExportMode <Base64|File>] [-OutputPath <String>] [-PassThru] [<CommonParameters>]#Parameter set:
PathParameters
- EnableHighlight SwitchParameter
- Wrap highlighted text with Markdown highlight markers.
- EnableUnderline SwitchParameter
- Wrap underlined text with HTML underline tags.
- FilePath String
- Path to a .docx file.
- 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.
Outputs
System.String System.IO.FileInfo
ConvertTo-OfficeWordMarkdown -Document <WordDocument> [-EnableHighlight] [-EnableUnderline] [-FontFamily <String>] [-ImageDirectory <String>] [-ImageExportMode <Base64|File>] [-OutputPath <String>] [-PassThru] [<CommonParameters>]#Parameter set:
DocumentParameters
- Document WordDocument
- Word document instance to convert.
- 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.
Outputs
System.String System.IO.FileInfo