title: Why can't I access $args from inside a function?
body: <p>Here is my code:</p>
  
  <pre><code># hi.ps1
  
  function fun
  {
      Write-Host $args
  }
  
  Write-Host '---------------'
  Write-Host $args
  Write-Host '---------------'
  fun
  Write-Host '---------------'
  </code></pre>
  
  <p>This is the output:</p>
  
  <pre><code>PS C:\scratch&gt; .\hi there jim
  ---------------
  there jim
  ---------------
  
  ---------------
  </code></pre>
  
  <p>My question is, why isn't $args visible within fun?</p>