title: Load variables from another powershell script
body: <p>I have several scripts that could be reusing variables so I'd like to isolate variables in their own Variables.ps1 script, i.e.</p>
  
  <pre><code>$var1 = "1"
  $var2 = "2"
  </code></pre>
  
  <p>I'm trying to load these variables then print them out in the Main.ps1 script like this:</p>
  
  <pre><code>.\Variables.ps1
  $var1
  $var2
  </code></pre>
  
  <p>This works if I first run .\Variables.ps1 but not if I just run Main.ps1. My environment is PowerShell ISE. What am I doing wrong?</p>