Types/OpenPackage/get_PowerShellCommandAst.ps1

<#
.SYNOPSIS
    Gets PowerShell Command References
.DESCRIPTION
    Gets PowerShell Command Ast references within an Open Package.
#>

foreach ($content in $this.GetContent(@($this.FileList -match '.psm?1$'))) {
    if (-not $content.Ast) { continue }
    $content.Ast.FindAll({
        param($ast)

        $ast -is [Management.Automation.Language.CommandAst]
    }, $true) |
        Add-Member NoteProperty PartUri $content.PartUri -Force -PassThru |
        Add-Member NoteProperty Package $content.Package -Force -PassThru
}