Extended Types and Types.XSD

Extended Types and Types.XSD

  • Comments 2

I'd like to draw your attention to a really important blog entry that Jim Truher recently made: PowerShell Extended Types (Includes a TYPES.XSD). In that entry, he talks about how powerful PowerShell's extended type system is. He is absolutely correct on this point, this is an incredibly important and powerful feature of the system that not enough people know about or are using. The basic idea is that you can have a set of XML files which add additional properties and methods to existing types.

The great thing that Jim did was to take the type to create an XSD for the XML files (I know- I know – it is our bad that we didn't do this from the get go). Now that you have an XSD for the xml files, you can use a number of tools to easily create these XML documents. In Visual Studio, you NEW an XML file, edit the file's properties and set the SCHEMA to point to this XSD file. From there you can edit the XML file and it Visual Studio's intellisense will show you want elements you can add at various parts of the document. This is great!

I know that WORD 2007 has the ability to take an XSD and use it to create XML files using nice document formatting but I don't know how to do it. I would love it if someone that knows how to do this could educate us.

You know how you can basically write C programs using C++ by avoiding all the power of C++? The first couple of C++ programs have that feel until you start taking the type to understand and leverage the power the new language provides you. Using PowerShell without taking advantage of the extended type system is exactly the same. You really do need to take the time to get this incredible feature in focus. I strongly encourage you to take a bit of time to read Jim's blog and begin understanding PowerShell's extended type system.

 

Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Leave a Comment
  • Please add 2 and 1 and type the answer here:
  • Post