title: Powershell ps1 file "is not recognized as a cmdlet, function, operable program, or script file."
body: <p>I made a Powershell function just now and saved it to a ps1 file.
  However, when I try to execute it from within powershell, it won't run.</p>
  
  <p>I've allready changed to the settings for running unsigned code by entering this command:</p>
  
  <pre><code>set-executionpolicy remotesigned
  </code></pre>
  
  <p>The function is this:</p>
  
  <pre><code>Function listAllPaths([string]$fromFolder, [string]$filter, [string]$printfile){
  Get-ChildItem -Path $fromFolder -Include $filter -Recurse -Force -Name &gt; $printfile
  }
  </code></pre>
  
  <p>What it does is create a textfile in which all the path's to a certain file are listed.<br />
  I've put it directly under c:\ and named the file listAllPaths, same as the function.</p>
  
  <p>When I enter the following command inside Powershell:</p>
  
  <pre><code>PS&gt; listAllPaths.ps1 c:\ *.pdf testingPDF.txt
  </code></pre>
  
  <p>I get an error saying:<br /></p>
  
  <blockquote>
    <p>The term 'listAllPaths.ps1' is not
    recognized as a cmdlet, function,
    operable program, or script file.
    Verify the term and try again.</p>
  </blockquote>
  
  <p>I've tried several things and I honestly don't know how to get this to work?
  What I expect is for a file to be created on the given path, c:\ in this example. That file having the name testingPDF.txt and the contents being the generated this.</p>
  
  <p>Can someone tell me what I'm forgetting here.</p>
  
  <p>And no, Google doesn't answer everything. Tried that one allready. I wouldn't come and ask it here if I hadn't allready tried the online search-engines.</p>