Types/OpenPackage/get_CodeOfConduct.md.ps1

<#
.SYNOPSIS
    Gets a package's code of conduct
.DESCRIPTION
    Gets any parts in the package named Code_Of_Conduct.md
#>

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

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

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

# We are done.