Types/OpenPackage/get_README.md.ps1

<#
.SYNOPSIS
    Gets a package's README
.DESCRIPTION
    Gets the content of any parts in the package named README.md
#>

[OutputType("text/markdown")]
param()

# Get all Readme files
foreach ($content in $this.GetContent(
    $this.FileList -match '/README\.md$'
)) {
    # decorate them as text/markdown
    if ($content.pstypenames -notcontains 'text/markdown') {
        $content.pstypenames.insert(0, 'text/markdown')
    }
    # and return them.
    $content
}

return