title: Powershell Function Not Recognised
body: <p>I've been putting my first powershell scripts together for the last couple of hours and I keep seeing an error that I can't seem to get to the bottom of.</p>
  
  <p>I'm using the Powershell ISE tool to write and run the scripts.</p>
  
  <p>To see if its something in my script I've created a super simple test script and I'm seeing the same problem.  The entire test script is:</p>
  
  <pre><code>Test;
  
  function Test
  {
      New-Item C:\Users\jgreen\Desktop\jammer\ -type directory
  }
  </code></pre>
  
  <p>When I hit the <code>Run Script</code> button the error produced is:</p>
  
  <pre><code>Test : The term 'Test' 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.
  </code></pre>
  
  <p>If I simply hit the <code>Run Script</code> button again, it work and does the job.  I simply do not understand what is wrong.  I simply don't get it.  Is there a problem with my script or not?</p>
  
  <p>Why would a script that works bomb out the first time after opening the script in PS ISE?</p>