title: Putting functions in separate script and dot-sourcing them - what will the scope be
body: <p>I've put my functions in a separate file and I call the file with:</p>
  
  <pre><code>$workingdir = Split-Path $MyInvocation.MyCommand.Path -Parent
  . "$workingdir\serverscan-functions.ps1"                        
  </code></pre>
  
  <p>But, if I call the scripts like</p>
  
  <pre><code>my-function
  </code></pre>
  
  <p>how will the variable scope (from within "my-function") be?
  Should I still $script:variable to make the variable exist outside the function or have I dot-sourced the function as well?</p>
  
  <p>Hope I don't confuse anyone with my question... I've tried to make it as understandable as possible, but still learning all the basic concept so I find it hard to explain..</p>