{"id":10801,"date":"2006-04-25T12:18:00","date_gmt":"2006-04-25T12:18:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2006\/04\/25\/sunday-morning-drive-with-my-hair-on-fire-typescommunitysynthetic-typesdemocracycool-xml-tricks\/"},"modified":"2019-02-18T13:25:03","modified_gmt":"2019-02-18T20:25:03","slug":"sunday-morning-drive-with-my-hair-on-fire-typescommunitysynthetic-typesdemocracycool-xml-tricks","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/sunday-morning-drive-with-my-hair-on-fire-typescommunitysynthetic-typesdemocracycool-xml-tricks\/","title":{"rendered":"Sunday morning drive with my hair on fire: Types\/Community\/Synthetic types\/Democracy\/Cool XML tricks"},"content":{"rendered":"<p>Exploring types is a pain!<\/p>\n<p>Monad provides Get-Member which makes it pretty nice to explore an OBJECT but if you want to explore that object&#8217;s type, you have to use the capabilities of the System.RuntimeType class.<\/p>\n<p>Let me make that distinction a little clearer.&nbsp; Imagine that I&#8217;ve got some xml:<br \/>$x=[XML]&#8221;&lt;a&gt;&lt;b&gt;TEST&lt;\/b&gt;&lt;a&gt;&#8221;<\/p>\n<p>I can explore this object using get-member (using the GM alias)<\/p>\n<p><font face=\"Courier New\" size=\"1\">MSH&gt; $x |gm<br \/>&nbsp;&nbsp; TypeName: System.Xml.XmlDocument<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemberType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Definition<br \/>&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;-<br \/>ToString&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CodeMethod&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; static System.St&#8230;<br \/>add_NodeChanged&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Method&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Void add_&#8230;<br \/>add_NodeChanging&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Method&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Void add_&#8230;<br \/>&#8230;<\/font><\/p>\n<p>But now imagine that I want to exlore System.XML.XMLDocument ([XML]) itself?&nbsp; Here is what you get:<\/p>\n<p><font face=\"Courier New\" size=\"1\">MSH&gt; [xml]<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\">IsPublic IsSerial Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BaseType<br \/>&#8212;&#8212;&#8211; &#8212;&#8212;&#8211; &#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8211;<br \/>True&nbsp;&nbsp;&nbsp;&nbsp; False&nbsp;&nbsp;&nbsp; XmlDocument&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System&#8230;.<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\">MSH&gt; [xml] |fl *<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\">Module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.dll<br \/>Assembly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml, Version=2.0.0.0, Culture=neu<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tral, PublicKeyToken=b77a5c561934e089<br \/>TypeHandle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.RuntimeTypeHandle<br \/>DeclaringMethod&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<br \/>BaseType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.XmlNode<br \/>UnderlyingSystemType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.XmlDocument<br \/>FullName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.XmlDocument<br \/>AssemblyQualifiedName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.XmlDocument, System.Xml, Vers<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ion=2.0.0.0, Culture=neutral, PublicKeyT<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oken=b77a5c561934e089<br \/>Namespace&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml<br \/>GUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 3d63bf4b-edbe-36cb-b7b2-df87f38db07d<br \/>GenericParameterAttributes :<br \/>IsGenericTypeDefinition&nbsp;&nbsp;&nbsp; : False<br \/>IsGenericParameter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>GenericParameterPosition&nbsp;&nbsp; :<br \/>IsGenericType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>ContainsGenericParameters&nbsp; : False<br \/>StructLayoutAttribute&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Runtime.InteropServices.StructLay<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outAttribute<br \/>Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : XmlDocument<br \/>MemberType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : TypeInfo<br \/>DeclaringType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<br \/>ReflectedType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<br \/>MetadataToken&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 33554636<br \/>TypeInitializer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Void .cctor()<br \/>IsNested&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>Attributes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : AutoLayout, AnsiClass, Class, Public, Be<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreFieldInit<br \/>IsVisible&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsNotPublic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsPublic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsNestedPublic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsNestedPrivate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsNestedFamily&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsNestedAssembly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsNestedFamANDAssem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsNestedFamORAssem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsAutoLayout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsLayoutSequential&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsExplicitLayout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsClass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsInterface&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsValueType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsAbstract&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsSealed&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsEnum&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsSpecialName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsImport&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsSerializable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsAnsiClass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsUnicodeClass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsAutoClass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsArray&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsByRef&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsPointer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsPrimitive&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsCOMObject&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>HasElementType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsContextful&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsMarshalByRef&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/><\/font><\/p>\n<p>So that has LOTS of great information but the things that I usually want are the types Constructors, Properties, Methods, Interfaces etc.&nbsp; That should be easy right?&nbsp; The type has the method GetConstructors().&nbsp; Lets see what that gives you.<\/p>\n<p><font face=\"Courier New\" size=\"1\">MSH&gt; [xml].GetConstructors()<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : .ctor<br \/>MemberType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Constructor<br \/>DeclaringType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.XmlDocument<br \/>ReflectedType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.XmlDocument<br \/>MetadataToken&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 100666404<br \/>Module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.dll<br \/>MethodHandle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.RuntimeMethodHandle<br \/>Attributes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : PrivateScope, Public, HideBySig, SpecialN<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ame, RTSpecialName<br \/>CallingConvention&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Standard, HasThis<br \/>IsGenericMethodDefinition : False<br \/>ContainsGenericParameters : False<br \/>IsGenericMethod&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsPublic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsPrivate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsFamily&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsAssembly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsFamilyAndAssembly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsFamilyOrAssembly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsStatic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsFinal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsVirtual&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsHideBySig&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsAbstract&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsSpecialName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsConstructor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\">Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : .ctor<br \/>MemberType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Constructor<br \/>DeclaringType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.XmlDocument<br \/>ReflectedType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.XmlDocument<br \/>MetadataToken&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 100666405<br \/>Module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.dll<br \/>MethodHandle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.RuntimeMethodHandle<br \/>Attributes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : PrivateScope, Public, HideBySig, SpecialN<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ame, RTSpecialName<br \/>CallingConvention&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Standard, HasThis<br \/>IsGenericMethodDefinition : False<br \/>ContainsGenericParameters : False<br \/>IsGenericMethod&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsPublic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsPrivate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsFamily&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsAssembly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsFamilyAndAssembly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsFamilyOrAssembly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsStatic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsFinal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsVirtual&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsHideBySig&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsAbstract&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False<br \/>IsSpecialName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>IsConstructor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/><\/font><\/p>\n<p>OK &#8211; well that is cool and there&nbsp;may be&nbsp;times when I&#8217;d like those details (that hasn&#8217;t happened up to this point in my life but I&#8217;m still reasonably young so I&#8217;m not ruling it out).&nbsp; What I want to know is what is the signature of the constructor?&nbsp; Well if you are smart enough to have an office near Bruce Payette, he may hear you ranting and come in to calm you down and inform you that the signatures area available when you do a ToString() so the way to get that is:<\/p>\n<p><font face=\"Courier New\" size=\"1\">MSH&gt; [xml].GetConstructors() |foreach {&#8220;$_&#8221;}<br \/>Void .ctor()<br \/>Void .ctor(System.Xml.XmlNameTable)<\/font><\/p>\n<p>Fine.&nbsp; Now let&#8217;s shift the discussion and talk about the power of community and the democratization of types.&nbsp; <\/p>\n<p>Look, its easy to sit back and throw rocks saying &#8211; &#8220;that is a complex experience, those idiots should have forseen that and made it simple for us&#8221;.&nbsp; That&nbsp;rock is&nbsp;completely fair.&nbsp; Now, if you go the next step and actually file a bug report, you might get this&nbsp;fixed in a couple of years.&nbsp; <\/p>\n<p>We designed MONAD with this in mind.&nbsp; My customers don&#8217;t have a couple of years to wait for the system to be fine tuned for their specific needs &#8211; my customers tend to run around with their hair on fire.&nbsp; They need solutions ASAP.&nbsp; One of the quickest ways to get a solution is to ask another smart person.&nbsp; In my case, I was lucky enough to have Bruce just down the hall but with the internet, Bruce is virtually just down the hall from everyone.&nbsp; (As a side note &#8211; I&#8217;ve just started to review a WONDERFUL book that Bruce is writing on Monad so in the future, you&#8217;ll all be $30 away from having Bruce be in your very own home.)<\/p>\n<p>&#8220;Yea &#8211; the internet is good and communities help get answers fast&#8221; &#8211; so what?.&nbsp; Well that&#8217;s a pretty big deal but now let&#8217;s turn our attention to the issue of what form community answers take and the differences in power these different forms take.&nbsp; For instance, if someone gives you some expository text describing the solution, that is useful but not nearly as useful as when someone gives you a&nbsp; piece of script that provides a solution.&nbsp; <\/p>\n<p>Now imagine that this goes on year after year, developer by developer &#8211; Where is all that code?&nbsp; How do people discover it?&nbsp; How do you maintain it?&nbsp; If you&#8217;ve pasted the code into your script, then there is a good chance that you&#8217;ve pasted it lots of time in lots of scripts and you&#8217;ve got a maintence mess on your hands.&nbsp; Also &#8211; how does someone (say a new admin) find this?&nbsp; If you factored it out into it&#8217;s own script then you still have a discoverability problem even though you&#8217;ve addressed the maintenance problem.<\/p>\n<p>Let&#8217;s step back and ask the question &#8211; why are we doing any of this anyway?&nbsp; The answer is that the developers that created System.RunTimeType did not implement that class in a way that meets&nbsp;our needs and they can&#8217;t react quickly enough for&nbsp;us to wait.&nbsp; But in the end, the best of all solutions is for this function to be implemented as part of the type.&nbsp; That way when I ask the type what it can do, it will tell me directly.&nbsp; I don&#8217;t have to go looking around in lots of scripts looking for whether there are additional functions layered on top.&nbsp; <\/p>\n<p>Monad addresses this problem with a synthetic type system which allows the democratization of types.&nbsp; Sure the developers of System.RunTimeType have an important role to play but they are just one voice in this this choir.&nbsp; Lots of people should be able to extend the type with their own functions. Below is a contents of a file&nbsp;MyTypes.mshxml (attached as well).&nbsp; This file defines a number of new properties (Constructors, Methods, Properties, Interfaces, Events) for this type.&nbsp; Type types are implemented using Monad so they are called ScriptProperites and in each case, the call an underlying api (using the $THIS variable which is set to the object being extended), sorting the elements by name&nbsp;and piping the results into a foreach loop which casts the data to a string for easy reading.<\/p>\n<p><font face=\"Courier New\" size=\"1\">&lt;Types&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;Type&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Name&gt;System.RuntimeType&lt;\/Name&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Members&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ScriptProperty&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Name&gt;Constructors&lt;\/Name&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GetScriptBlock&gt;$this.GetConstructors() | foreach {&#8220;$_&#8221;}&lt;\/GetScriptBlock&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/ScriptProperty&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ScriptProperty&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Name&gt;Methods&lt;\/Name&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GetScriptBlock&gt;$this.GetMethods() |sort name | foreach {&#8220;$_&#8221;}&lt;\/GetScriptBlock&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/ScriptProperty&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ScriptProperty&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Name&gt;Properties&lt;\/Name&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GetScriptBlock&gt;$this.GetProperties() |sort name | foreach {&#8220;$_&#8221;}&lt;\/GetScriptBlock&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/ScriptProperty&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ScriptProperty&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Name&gt;Interfaces&lt;\/Name&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GetScriptBlock&gt;$this.GetInterfaces() |sort name | foreach {&#8220;$_&#8221;}&lt;\/GetScriptBlock&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/ScriptProperty&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ScriptProperty&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Name&gt;Events&lt;\/Name&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GetScriptBlock&gt;$this.GetEvents() |sort name | foreach {&#8220;$_&#8221;}&lt;\/GetScriptBlock&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/ScriptProperty&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/Members&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;\/Type&gt;<br \/>&lt;\/Types&gt;<\/font><\/p>\n<p>&nbsp;<\/p>\n<p>The command <font face=\"Courier New\" size=\"2\"><strong>Update-TypeData MyTypes.mshxml<\/strong><\/font>&nbsp;&nbsp; imports this information and updates the typedata for System.RuntimeType (I have a number of such statements in my profile file).&nbsp; Now when I inspect types, this information is also available:<\/p>\n<p><font face=\"Courier New\" size=\"1\">MSH&gt; [xml] |fl *<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\">Constructors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : {Void .ctor(), Void .ctor(System.Xml.Xml<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NameTable)}<br \/>Methods&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : {Void add_NodeChanged(System.Xml.XmlNode<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ChangedEventHandler), Void add_NodeChang<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ing(System.Xml.XmlNodeChangedEventHandle<br \/>&nbsp;&#8230;<br \/>Properties&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : {System.Xml.XmlAttributeCollection Attri<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; butes, System.String BaseURI, System.Xml<br \/>&#8230;<br \/>Interfaces&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : {System.ICloneable, System.Collections.I<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Enumerable, System.Xml.XPath.IXPathNavig<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; able}<br \/>Events&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : {System.Xml.XmlNodeChangedEventHandler N<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; odeChanged, System.Xml.XmlNodeChangedEve<br \/>&#8230;<br \/>Module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml.dll<br \/>Assembly&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : System.Xml, Version=2.0.0.0, Culture=neu<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tral, PublicKeyToken=b77a5c561934e089<br \/>&#8230;<br \/>MSH&gt; [xml].constructors<br \/>Void .ctor()<br \/>Void .ctor(System.Xml.XmlNameTable)<\/p>\n<p>MSH&gt; [xml].interfaces<br \/>System.ICloneable<br \/>System.Collections.IEnumerable<br \/>System.Xml.XPath.IXPathNavigable<\/p>\n<p>MSH&gt; [xml].events<br \/>System.Xml.XmlNodeChangedEventHandler NodeChanged<br \/>System.Xml.XmlNodeChangedEventHandler NodeChanging<br \/>System.Xml.XmlNodeChangedEventHandler NodeInserted<br \/>System.Xml.XmlNodeChangedEventHandler NodeInserting<br \/>System.Xml.XmlNodeChangedEventHandler NodeRemoved<br \/>System.Xml.XmlNodeChangedEventHandler NodeRemoving<\/font><\/p>\n<p>See how easy and powerful that is?&nbsp; Again, we want to build a system which is self-discoverable.&nbsp; That is why are are hard-core about naming (consistency on naming makes it easy for you to guess what to do and be right).&nbsp; It is also why we provide interactive exploration tools like Get-Member and the interactive shell.&nbsp; By using a synthetic type system, we allow new extensions to be added in a way that makes it easy for you to discover and utilize them.&nbsp; <\/p>\n<p>Cool but wait a minute.&nbsp; Did you notice that the XML datatype supports the NodeChanged Event.&nbsp; What&#8217;s up with that?&nbsp; Let&#8217;s check it out.&nbsp; Rember that I defined $x to be an xml fragment up above, let&#8217;s use to explore using the Start-NewScope function I provided yesterday:<\/p>\n<p><font face=\"Courier New\" size=\"1\">MSH&gt; $x.Add_NodeChanged({Start-NewScope &#8220;NODE CHANGED&gt; &#8220;})<br \/>MSH&gt; $x.a.b&nbsp; = &#8220;New Value&#8221;<br \/>Starting New Scope<br \/>NODE CHANGED&gt; $this | fl *<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\">a : a<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\"><\/font>&nbsp;<\/p>\n<p><font face=\"Courier New\" size=\"1\">NODE CHANGED&gt; $_ | fl *<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\">Action&nbsp;&nbsp;&nbsp; : Change<br \/>Node&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : #text<br \/>OldParent : b<br \/>NewParent : b<br \/>OldValue&nbsp; : TEST<br \/>NewValue&nbsp; : New Value<\/font><\/p>\n<p><font face=\"Courier New\" size=\"1\"><\/font>&nbsp;<\/p>\n<p><font face=\"Courier New\" size=\"1\">NODE CHANGED&gt; exit<br \/>MSH&gt; $x=[xml]&#8221;&lt;a&gt;&lt;b&gt;TEST&lt;\/b&gt;&lt;\/a&gt;&#8221;<\/p>\n<p>MSH&gt; $x.Add_NodeChanged({Write-Host $(&#8220;XMLChange old {0} new {1}&#8221; -f $<br \/>_.OldValue, $_.NewValue)})<\/p>\n<p>MSH&gt; $x.a.b=&#8221;NEW-VALUE&#8221;<br \/>XMLChange old TEST new NEW-VALUE<\/font><\/p>\n<p>Is that cool or what?&nbsp; I would have not known about that unless I was exploring the type.&nbsp; 3 cheers for the democratization of types!&nbsp; Now just to be clear, democracies&nbsp;can be&nbsp;messy things (that is why I like the analogy).&nbsp; With lots of people updating the types, you can get name collisions, differing quality levels, etc.&nbsp; There is no doubt that there are downsides to this model and that if you can get the original development teams to modify that type to meet your needs &#8211; it is a better model.&nbsp; But for those of us that don&#8217;t have either&nbsp;the bandwidth to engage the original development teams, the ability to convince the teams that our scenarios are going to be needed by 80+% of the people, or the luxury of waiting a few years for the process to work itself out&nbsp; &#8211; there is now a mechanism for us with our hair on fire to stick our heads in a bucket of water.&nbsp; Sure, doing this might leave us the smell of burnt hair but I&#8217;d rather have&nbsp;that than to have my hair still on fire.&nbsp; \ud83d\ude42<\/p>\n<p>Enjoy!<\/p>\n<p>Jeffrey Snover<br \/>Monad Architect<\/p>\n<p>[<i>Edit: Monad has now been renamed to Windows PowerShell. This script or discussion may require slight adjustments before it applies directly to newer builds.<\/i>]<\/p>\n<p>PSMDTAG:TYPE:XML: XML normalized object access<\/p>\n<p>PSMDTAG:DOTNET: GetConstructors(), constructor, RuntimeType, <\/p>\n<p>PSMDTAG:PHILOSOPHY: Democratization of types allow users to solve problems without having to wait for vendors to help.<\/p>\n<p>PSMDTAG:PHILOSOPHY: Extending types makes it easy to organize and discover functions<\/p>\n<p>PSMDTAG:CMDLET: Update-TypeData<\/p>\n<p>PSMDTAG:FAQ: How do I see what the constructors for a type are?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Exploring types is a pain! Monad provides Get-Member which makes it pretty nice to explore an OBJECT but if you want to explore that object&#8217;s type, you have to use the capabilities of the System.RuntimeType class. Let me make that distinction a little clearer.&nbsp; Imagine that I&#8217;ve got some xml:$x=[XML]&#8221;&lt;a&gt;&lt;b&gt;TEST&lt;\/b&gt;&lt;a&gt;&#8221; I can explore this object [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[12,14,10,22],"class_list":["post-10801","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-cmdlet","tag-dotnet","tag-faq","tag-typexml"],"acf":[],"blog_post_summary":"<p>Exploring types is a pain! Monad provides Get-Member which makes it pretty nice to explore an OBJECT but if you want to explore that object&#8217;s type, you have to use the capabilities of the System.RuntimeType class. Let me make that distinction a little clearer.&nbsp; Imagine that I&#8217;ve got some xml:$x=[XML]&#8221;&lt;a&gt;&lt;b&gt;TEST&lt;\/b&gt;&lt;a&gt;&#8221; I can explore this object [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/10801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=10801"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/10801\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=10801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=10801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=10801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}