title: Powershell Global scope with concurrent script execution
body: <p>I am writing a script to power off and power on VM's from a list of servers the user provides.</p>
  
  <p>In a function I verify that the server exists in our environment and need to track the good servers I actually power off in an array.  In order to solve a scope issue for this array variable I was going to make it global, but am wondering if a global variable would be affected if multiple users ran this script from the same server at the same time, since I know it would be in scope for the shell.</p>
  
  <p>I have tried to run script level scope but it does not seem to work for me properly.  Does anyone know if global would cause an issue in this case?</p>
  
  <p>ex:</p>
  
  <pre><code>$powerOn = [System.Collections.ArrayList]@()
  foreach ($server in $servers){
        powerOff($server)
  }
  
  Function powerOff($name){
        #Code to check if server exists
        #if exists
        $Global:powerOn.add($name)
  }
  </code></pre>