title: How to load variable from one PowerShell script to another?
body: <p>I have a main script that is calling on several others scripts and I need to load the variables from the other scripts into the main script so that I can dump them into a html file. I tried dot sourcing the scripts I am calling on but that did not work or I am doing something wrong. Any help would be appreciated.  </p>
  
  <p>Example section of script:</p>
  
  <pre><code>.\get-cluster.ps1
  
  $MyReport += Get-CustomHeader "Clusters not in compliance : $($CapacityInfo.count) ($MyReport += Get-HTMLTable $capacityinfo
  $MyReport += Get-CustomHeaderClose
  </code></pre>
  
  <p>The variable <code>$capacityinfo</code> exists in the <code>get-cluster.ps1</code> script</p>