title: Why is Powershell not recognizing System.Data inside Add_Type block?
body: <p>I am trying to write a PS script that will open a stored proc, pass parameters and execute that proc, then output the data to a DataSet.  That all seems to work, but whern I try to create a .NET object inside an Add-Type block, I get the error:</p>
  
  <blockquote>
    <p>The type or namespace 'Data' does not exist in the namespace 'System'
    (are you missing an assembly reference?)</p>
  </blockquote>
  
  <p>Here's the code:</p>
  
  <pre><code>Add-Type @'
  using System.Data;
  using System.Collections.Generic;
  
  public class TestObject
  {...}
  '@  
  </code></pre>
  
  <p>The part that's really confusing me is that I create a DataSet in another part of the code, outside of the .NET class, and the reference to System.Data.DataSet works fine.</p>
  
  <p>Any thoughts on this are greatly appreciated.</p>