title: XmlSerializer's functionality in PowerShell?
body: <p>Is there a way to leverage the functionality of .NET's XmlSerializer class in PowerShell?</p>
  
  <p>More specifically, the ability to easily de/serialize .NET types into Xml e.g.</p>
  
  <pre><code>XmlSerializer s = new XmlSerializer(typeof(MyType));
  TextReader r = new StreamReader("sample.xml");
  MyType myType = (MyType)s.Deserialize(r);
  r.Close();
  </code></pre>
  
  <p>I know I can call above from PowerShell, but is there a way to avoid defining MyType in a separate assembly? Thanks</p>
  
  <p>[Edit] Since seems to be that .NET-like types cannot be added from PowerShell, allow me to re-target my question: is there an easy way, like XmlSerializer, to serialize types in PowerShell? I have to read/write some .xml's from PS, and would rather leverage such functionality before manually doing it.</p>