If I have the following code, is it possible to pass the collection of parameters passed to New-AutomationVM to the inner Deploy workflow without individually specifying them.
New-AutomationVM is likely to have ~20 parameters, and that is going to be a considerable piece of code to then integrate into a second internal workflow. (that seems vulnerable to errors)
Is there a better way? (I'm sure at some point I've read about all parameters being included in a psobject style variable, but I can't find a reference to it any more)
workflow New-AutomationVM
{
Param($var1,$var2)
workflow Pre-DeploymentChecks
{ Write-Output $true }
workflow Deploy
{
Param($var1,$var2)
$checkResult = Pre-DeploymentChecks
}
Deploy -var1 $var1 -var2 $var2
}
New-AutomationVM -var1 "var1" -var2 "var2"