Get-ContentWithoutHeader

Get-ContentWithoutHeader

SYNOPSIS

Gets the content of a Markdown file without the YAML frontmatter.

SYNTAX

Get-ContentWithoutHeader [-Path] <string> [<CommonParameters>]

DESCRIPTION

The cmdlet gets the content of a Markdown file without the YAML frontmatter. This is useful when updating the metadata of the file or for passing Markdown text to another command for processing.

EXAMPLES

Example 1 - Render the Markdown file as HTML

This example passes the Markdown content to ConvertFrom-Markdown to convert it to HTML.

Get-ContentWithoutHeader .\Update-Metadata.md |
    ConvertFrom-Markdown |
    Select-Object -ExpandProperty Html

PARAMETERS

-Path

The path to the Markdown file.

Type: System.Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES

See the source code for Update-Metadata for another example.