title: Calling a function within PowerShell ISE
body: <p>Could someone tell me why I can not call a function within a PowerShell script? See below my code:</p>
  
  <pre><code>Write-Host "Before calling Function."
  
  testFunction
  
  function testFunction()
  { 
      Write-Host "Function has been called"
  }
  </code></pre>
  
  <p>When I run the above code I get the following error message:</p>
  
  <pre>testFunction : The term 'testFunction' is not recognized as the name of a cmdlet,
  function, script file, or operable program. Check the spelling of the name, or if
  a path was included, verify that the path is correct and try again.
  At C:\Users\andrew.short\Documents\Powershell\Backups\functionTest.ps1:3 char:1
  + testFunction
  + ~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (testFunction:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException</pre>
  
  <p>I'm sure that it must be possible to call functions within the same PowerShell script. Can somebody please help?</p>