Types/OpenPackage/get_CHANGELOG.md.ps1

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

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

# Get every part
foreach ($part in $this.GetParts()) {
    # and ignore any part not named CHANGELOG
    if ($part.Uri -notmatch '/CHANGELOG\.md$') { continue }

    if ($part.Reader) {
        $part.Read()
    } else {
        $part
    }    
}

# We are done.