title: How to call a function from a function within a workflow
body: <p>I am trying to create a Powershell workflow with a number of functions inside it. </p>
  
  <p>My code, and the error... </p>
  
  <pre><code>workflow New-AutomationVM
  {
      function Pre-DeploymentChecks
      { Write-Output $true }
  
      function Deploy 
      { $checkResult = Pre-DeploymentChecks }
  
      Deploy
  }
  New-AutomationVM 
  </code></pre>
  
  <blockquote>
    <p>The term 'Pre-DeploymentChecks' is not recognized as the name of a cmdlet, function, script file, or operable program.</p>
  </blockquote>
  
  <p>My intention was to create a deploy function that encapsulated all of the other functions. But it seems not possible to call a function from within a function within a workflow. i.e. I can call Pre-DeploymentChecks from the workflow, but not the function. </p>
  
  <p>Obviously I could just put that logic outside of the functions, but this approach seemed a little tidier.</p>
  
  <p>Am I doing something stupid! or is this just not possible within Powershell workflows? </p>