title: Passing parameters to function: Cannot bind argument to parameter
body: <p>I am receiving the following error message: </p>
  
  <blockquote>
    <p>Cannot bind argument to parameter 'FilePath' because it is an empty string.</p>
  </blockquote>
  
  <p>from this code:</p>
  
  <pre><code>$image = "image"
  $logfile_name = "log.txt"
  
  cleanup $image $logfile_name
  
  function cleanup($image, $logfile) {
     log_message "message" $logfile
  }
  
  function log_message($msg, $logfile) {
      $msg | Tee-Object -Append -FilePath "$logfile"
  }
  </code></pre>
  
  <p>I've tried with and without the quotes, what am I doing wrong?</p>
  
  <p>Edit: I've tried to echo the value and it existing but when I ran it in the log_message command it says its null/empty string.</p>