'Functions do not get loaded into Workflow

When I use a Workflow, only the functions directly called in the Workflow get loaded from the calling script.
When dot-sourcing the following script and call Main-Function, I get the following output:

function First-Function($Param){
    Write-Output "In A: $Param"
}

function Second-Function(){
    Write-Output "In B!"
    First-Function "Testparam"
}

function Main-Function(){
    Workflow Test-Workflow{
        Second-Function
    }
    Test-Workflow
}

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source