Private/Invoke-SFDerivedOutput.ps1

function Invoke-SFDerivedOutput {
    [CmdletBinding()]
    [OutputType([object[]])]
    param (
        [Parameter(Mandatory)] [AllowEmptyCollection()] [object[]]$Resources,
        [Parameter(Mandatory)] [hashtable]$DerivedOutput
    )

    switch ([string]$DerivedOutput.Processor.Type) {
        'LatestByGroup' {
            return @(Select-SFLatestByGroup -Resources $Resources -Processor $DerivedOutput.Processor)
        }
        default {
            throw "Unsupported derived-output processor '$($DerivedOutput.Processor.Type)'."
        }
    }
}