private/StatusMessage/Write-AutoGeneratedFunctionCallMessages.ps1

function Write-AutoGeneratedFunctionCallMessages {
    <#
    .DESCRIPTION
        Writes a series of messages logging the function call.
    #>

    [OutputType([HashTable])]
    [CmdletBinding()]
    param ( [Parameter(Mandatory,ValueFromPipeline)] [HashTable] $MessageObject )

    process {

        try {

            Write-StatusMessage -Type 'Process' `
                                -ForceWrite `
                                -PreSpace `
                                -Message $( 'Function Call: {0}' -f $MessageObject.TargetFunctionName )
                                
            Write-StatusMessage -Type 'Debug' `
                                -ForceWrite `
                                -IndentationLevel 1 `
                                -Message $( 'Function File: {0}' -f $MessageObject.TargetFunctionFile )
                                
            Write-StatusMessage -Type 'Debug' `
                                -ForceWrite `
                                -IndentationLevel 1 `
                                -Message $( 'Invocation Source: {0}, line {1}' -f $MessageObject.InvocationSource,
                                                                                  $MessageObject.InvocationLine)
                                
            Write-StatusMessage -Type 'Debug' `
                                -ForceWrite `
                                -IndentationLevel 1 `
                                -Message $( 'Invocation File: {0}' -f $MessageObject.InvocationFile )
                                
            if ( $MessageObject.IncludeParameters ) {

                Write-StatusMessage -Type 'Debug' -IndentationLevel 1 -Message $( 'Bound Parameters:')
                                
                $MessageObject.TargetFunctionParams.keys | ForEach-Object {
                    Write-StatusMessage -Type 'Debug' `
                                        -ForceWrite `
                                        -IndentationLevel 2 `
                                        -Message $( '{0}: {1}' -f $_, $MessageObject.TargetFunctionParams.$_ )
                }

            }

        }
        catch {

            Write-ExceptionMessage -e $_

        }

    }
}