title: Failing to pass a variable to Get-Content
body: <p>What im trying to do:</p>
  
  <p>Run a script and load the content from an XML file. I have more then one XML file and I want it to load all of the XML files and then run them in a <code>foreach</code> loop.</p>
  
  <p>I don't know why, but my second <code>Get-Content</code> always comes back empty.</p>
  
  <p>Here is the crucial part of the code that isn't working for me:</p>
  
  <pre class="lang-bsh prettyprint-override"><code>[xml]$xmlist = Get-Content "C:\Users\user\Desktop\Test.xml"
  
  $x = $xmlist.Test.Test1.Test2
  
  foreach ($newxml in $x) {
      [xml]$xml1 = Get-Content $newxml
      $x2 = $xml1.Test.Testa.Testb
  }
  </code></pre>
  
  <p><code>$xml1</code> is just staying blank and nothing gets loaded into it (while in <code>$newxml</code> I have the right path each time).</p>
  
  <p>The error I get:</p>
  
  <pre>
  Get-Content : Cannot find path 'C:\windows\system32\System.Xml.XmlElement'
  because it does not exist.
  At C:\Users\samueu\Desktop\PS Script\Untitled15.ps1:7 char:14
  + [xml]$xml1 = Get-Content $newxml
  +              ~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (C:\windows\syst....Xml.XmlElement:String) [Get-Content], ItemNotFoundException
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
  </pre>
  
  <p>Here is the XML : </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;Test&gt;
      &lt;Test1&gt;
          &lt;Test2&gt;
              &lt;Filepath&gt;"C:\Users\user\Desktop\a.xml"&lt;/Filepath&gt;
          &lt;/Test2&gt;
          &lt;Test2&gt;
              &lt;Filepath&gt;"C:\Users\user\Desktop\b.xml"&lt;/Filepath&gt;
          &lt;/Test2&gt;
          &lt;Test2&gt;
              &lt;Filepath&gt;"C:\Users\user\Desktop\c.xml"&lt;/Filepath&gt;
          &lt;/Test2&gt;
          &lt;Test2&gt;
              &lt;Filepath&gt;"C:\Users\user\Desktop\e.xml"&lt;/Filepath&gt;
          &lt;/Test2&gt;
      &lt;/Test1&gt;
  &lt;/Test&gt;
  </code></pre>