Cmdlet
Get-OfficeMarkdownFrontMatter
Gets top-level YAML or TOML front matter entries from a Markdown document as Key, Value, Node and SourceSpan objects.
Syntax
Get-OfficeMarkdownFrontMatter
[-CaseSensitive]
[-Document <MarkdownDocument>]
[-Key <String>]
[<CommonParameters>]#Parameter set:
DocumentGet-OfficeMarkdownFrontMatter
[-CaseSensitive]
[-Key <String>]
[-Options <Object[]>]
[-Path] <String>
[<CommonParameters>]#Parameter set:
PathGet-OfficeMarkdownFrontMatter
[-CaseSensitive]
[-Key <String>]
-LiteralPath <String>
[-Options <Object[]>]
[<CommonParameters>]#Parameter set:
LiteralPathGet-OfficeMarkdownFrontMatter
[-CaseSensitive]
[-Key <String>]
[-Options <Object[]>]
-Text <String>
[<CommonParameters>]#Parameter set:
TextDescription
Gets YAML front matter entries from a Markdown document.
Examples
Read selected front matter from a Markdown file.
$metadata = Get-OfficeMarkdownFrontMatter -Path .\Report.md -Key 'title'
$metadata |
Select-Object -Property Key, Value |
Format-Table -AutoSizeParses a Markdown file and returns matching front matter entries for metadata proof.
Parse front matter from generated text.
$markdown = "---`ntitle: Report`nstatus: Ready`n---`n# Report"
Get-OfficeMarkdownFrontMatter -Text $markdown |
Select-Object -Property Key, ValueParses Markdown text directly when the document has not been saved yet.
Parameters
- -CaseSensitive SwitchParameter
- Use case-sensitive matching for key filters.
- -Document MarkdownDocument
- Caller-owned document; omission uses the enclosing Markdown document.
- -Key String
- Optional wildcard pattern matched against front matter keys.
- -Options Object[]
- Native reader options and optional native-property hashtable overrides.
- -Path String
- Input file with FileSystem wildcard expansion.
- -LiteralPath String
- Literal input file, including a FileInfo pipeline.
- -Text String
- Markdown source text.
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.