title: Call a function in another script when executing using 'Run With PowerShell'
body: <p>I have functions in a 'library' file to be called from my 'worker' script. </p>
  
  <p><strong>Library File</strong></p>
  
  <pre><code>function ShowMessage($AValue)
  {
    $a = new-object -comobject wscript.shell
    $b = $a.popup( $AValue )
  }
  </code></pre>
  
  <p><strong>Worker File</strong></p>
  
  <pre><code>. {c:\scratch\b.ps1}
  
  ShowMessage "Hello"
  </code></pre>
  
  <p>Running the 'worker' script works fine when in the PowerShell IDE but when I right-click the worker file and choose 'Run with PowerShell' it cannot find the function 'ShowMessage'. Both files are in the same folder. What might be happening?</p>