In the past I used the technique where I put all the common stuff in powershell module file, and do:
workflow Hey
{
PrepareMachine
ConfigureIIS
}
function PrepareMachine() {
Import-Module "MyCommonStuff"
CallSomethingBlahBlah()
}
function ConfigureIIS {
Import-Module "MyCommonStuff"
CallSomethingBlahBlah2()
}
You don't even have to wrap it in a module, you could just define the function out of workflow, and it would still work:
workflow Hey
{
InlineScript {
func1
}
}
function func1 {
Write-Output "Boom!"
}
That said, I was not impressed by workflows at all. Seems like quite pointless feature if you ask me. The most useful stuff about workflows is the ability to run things in parallel, but jobs can do it too. The idea above rant is that make sure you really do need workflows :)