<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>John S Blackman</title>
    <link>http://www.johnblackman.com/</link>
    <description>Contribute, look dumb, fear not, repeat.</description>
    <language>en-us</language>
    <copyright>John S Blackman</copyright>
    <lastBuildDate>Tue, 23 Jun 2009 06:09:30 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>johnsblac@gmail.com</managingEditor>
    <webMaster>johnsblac@gmail.com</webMaster>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=00e6dc9e-da9f-4030-8e58-30e29dc4821d</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,00e6dc9e-da9f-4030-8e58-30e29dc4821d.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,00e6dc9e-da9f-4030-8e58-30e29dc4821d.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=00e6dc9e-da9f-4030-8e58-30e29dc4821d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Well I am back in Seattle again, and it's an especially nice place to be i nthe summer
if I can get out of the office. Windows 7 is close to shipping and we've gone on a
secound round of visiting OEMs to test their images for the new flagship OS. On naked
machines the numbers are better across the board. The biggest problem now still remains
bundled software which isn't a problem per se, but when you add more software to a
machine, it has more to do, more to store, more to read so it is going to have a performance
cost. The build in WDDM drivers are quite good too for most of the hardware I've seen.
This will certainly improve as those drivers are replaced by hardware vendor specific
ones. However I think it's really cool that you can take most shake and bake laptops
or desktops, install Windows 7 on it and it just works.
</p>
        <p>
As a mac fan, I am very happy to see Windows 7 look a lot better too. It's just shinier.
The icons are bigger and higer resolution, and everything has a little candy sheen
to it. I love using Mac's, but I always come back to Windows because Entourage is
a pale shadow of Outlook, and Visual Studio is unparalleled by anything I've seen
on the Mac. Their development tools are probably excellent if you are used to their
SDK, but I'm such a .NET head now, that I can just do more faster with that SDK, so
I keep coming back to it.
</p>
        <img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=00e6dc9e-da9f-4030-8e58-30e29dc4821d" />
      </body>
      <title>Windows 7 is really better!</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,00e6dc9e-da9f-4030-8e58-30e29dc4821d.aspx</guid>
      <link>http://www.johnblackman.com/2009/06/23/Windows7IsReallyBetter.aspx</link>
      <pubDate>Tue, 23 Jun 2009 06:09:30 GMT</pubDate>
      <description>&lt;p&gt;
Well I am back in Seattle again, and it's an especially nice place to be i nthe summer
if I can get out of the office. Windows 7 is close to shipping and we've gone on a
secound round of visiting OEMs to test their images for the new flagship OS. On naked
machines the numbers are better across the board. The biggest problem now still remains
bundled software which isn't a problem per se, but when you add more software to a
machine, it has more to do, more to store, more to read so it is going to have a performance
cost. The build in WDDM drivers are quite good too for most of the hardware I've seen.
This will certainly improve as those drivers are replaced by hardware vendor specific
ones. However I think it's really cool that you can take most shake and bake laptops
or desktops, install Windows 7 on it and it just works.
&lt;/p&gt;
&lt;p&gt;
As a mac fan, I am very happy to see Windows 7 look a lot better too. It's just shinier.
The icons are bigger and higer resolution, and everything has a little candy sheen
to it. I love using Mac's, but I always come back to Windows because Entourage is
a pale shadow of Outlook, and Visual Studio is unparalleled by anything I've seen
on the Mac. Their development tools are probably excellent if you are used to their
SDK, but I'm such a .NET head now, that I can just do more faster with that SDK, so
I keep coming back to it.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=00e6dc9e-da9f-4030-8e58-30e29dc4821d" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,00e6dc9e-da9f-4030-8e58-30e29dc4821d.aspx</comments>
      <category>Code</category>
      <category>Mac</category>
      <category>Performance</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=11eea777-c9ff-4443-9144-5400aa8f055d</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,11eea777-c9ff-4443-9144-5400aa8f055d.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,11eea777-c9ff-4443-9144-5400aa8f055d.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=11eea777-c9ff-4443-9144-5400aa8f055d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Well I am back in Seattle again, and it's an especially nice place to be i nthe summer
if I can get out of the office. Windows 7 is close to shipping and we've gone on a
secound round of visiting OEMs to test their images for the new flagship OS. On naked
machines the numbers are better across the board. The biggest problem now still remains
bundled software which isn't a problem per se, but when you add more software to a
machine, it has more to do, more to store, more to read so it is going to have a performance
cost. The build in WDDM drivers are quite good too for most of the hardware I've seen.
This will certainly improve as those drivers are replaced by hardware vendor specific
ones. However I think it's really cool that you can take most shake and bake laptops
or desktops, install Windows 7 on it and it just works.
</p>
        <p>
As a mac fan, I am very happy to see Windows 7 look a lot better too. It's just shinier.
The icons are bigger and higer resolution, and everything has a little candy sheen
to it. I love using Mac's, but I always come back to Windows because Entourage is
a pale shadow of Outlook, and Visual Studio is unparalleled by anything I've seen
on the Mac. Their development tools are probably excellent if you are used to their
SDK, but I'm such a .NET head now, that I can just do more faster with that SDK, so
I keep coming back to it.
</p>
        <img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=11eea777-c9ff-4443-9144-5400aa8f055d" />
      </body>
      <title>Windows 7 is better, really it is!</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,11eea777-c9ff-4443-9144-5400aa8f055d.aspx</guid>
      <link>http://www.johnblackman.com/2009/06/23/Windows7IsBetterReallyItIs.aspx</link>
      <pubDate>Tue, 23 Jun 2009 06:08:29 GMT</pubDate>
      <description>&lt;p&gt;
Well I am back in Seattle again, and it's an especially nice place to be i nthe summer
if I can get out of the office. Windows 7 is close to shipping and we've gone on a
secound round of visiting OEMs to test their images for the new flagship OS. On naked
machines the numbers are better across the board. The biggest problem now still remains
bundled software which isn't a problem per se, but when you add more software to a
machine, it has more to do, more to store, more to read so it is going to have a performance
cost. The build in WDDM drivers are quite good too for most of the hardware I've seen.
This will certainly improve as those drivers are replaced by hardware vendor specific
ones. However I think it's really cool that you can take most shake and bake laptops
or desktops, install Windows 7 on it and it just works.
&lt;/p&gt;
&lt;p&gt;
As a mac fan, I am very happy to see Windows 7 look a lot better too. It's just shinier.
The icons are bigger and higer resolution, and everything has a little candy sheen
to it. I love using Mac's, but I always come back to Windows because Entourage is
a pale shadow of Outlook, and Visual Studio is unparalleled by anything I've seen
on the Mac. Their development tools are probably excellent if you are used to their
SDK, but I'm such a .NET head now, that I can just do more faster with that SDK, so
I keep coming back to it.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=11eea777-c9ff-4443-9144-5400aa8f055d" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,11eea777-c9ff-4443-9144-5400aa8f055d.aspx</comments>
      <category>Code</category>
      <category>Mac</category>
      <category>Performance</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=27bed1fc-5962-47f9-a220-bb24f27f022f</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,27bed1fc-5962-47f9-a220-bb24f27f022f.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,27bed1fc-5962-47f9-a220-bb24f27f022f.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=27bed1fc-5962-47f9-a220-bb24f27f022f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Well I am back in Seattle again, and it's an especially nice place to be i nthe summer
if I can get out of the office. Windows 7 is close to shipping and we've gone on a
secound round of visiting OEMs to test their images for the new flagship OS. On naked
machines the numbers are better across the board. The biggest problem now still remains
bundled software which isn't a problem per se, but when you add more software to a
machine, it has more to do, more to store, more to read so it is going to have a performance
cost. The build in WDDM drivers are quite good too for most of the hardware I've seen.
This will certainly improve as those drivers are replaced by hardware vendor specific
ones. However I think it's really cool that you can take most shake and bake laptops
or desktops, install Windows 7 on it and it just works.
</p>
        <p>
As a mac fan, I am very happy to see Windows 7 look a lot better too. It's just shinier.
The icons are bigger and higer resolution, and everything has a little candy sheen
to it. I love using Mac's, but I always come back to Windows because Entourage is
a pale shadow of Outlook, and Visual Studio is unparalleled by anything I've seen
on the Mac. Their development tools are probably excellent if you are used to their
SDK, but I'm such a .NET head now, that I can just do more faster with that SDK, so
I keep coming back to it.
</p>
        <img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=27bed1fc-5962-47f9-a220-bb24f27f022f" />
      </body>
      <title>Windows 7 is better, really it is!</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,27bed1fc-5962-47f9-a220-bb24f27f022f.aspx</guid>
      <link>http://www.johnblackman.com/2009/06/23/Windows7IsBetterReallyItIs.aspx</link>
      <pubDate>Tue, 23 Jun 2009 06:07:57 GMT</pubDate>
      <description>&lt;p&gt;
Well I am back in Seattle again, and it's an especially nice place to be i nthe summer
if I can get out of the office. Windows 7 is close to shipping and we've gone on a
secound round of visiting OEMs to test their images for the new flagship OS. On naked
machines the numbers are better across the board. The biggest problem now still remains
bundled software which isn't a problem per se, but when you add more software to a
machine, it has more to do, more to store, more to read so it is going to have a performance
cost. The build in WDDM drivers are quite good too for most of the hardware I've seen.
This will certainly improve as those drivers are replaced by hardware vendor specific
ones. However I think it's really cool that you can take most shake and bake laptops
or desktops, install Windows 7 on it and it just works.
&lt;/p&gt;
&lt;p&gt;
As a mac fan, I am very happy to see Windows 7 look a lot better too. It's just shinier.
The icons are bigger and higer resolution, and everything has a little candy sheen
to it. I love using Mac's, but I always come back to Windows because Entourage is
a pale shadow of Outlook, and Visual Studio is unparalleled by anything I've seen
on the Mac. Their development tools are probably excellent if you are used to their
SDK, but I'm such a .NET head now, that I can just do more faster with that SDK, so
I keep coming back to it.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=27bed1fc-5962-47f9-a220-bb24f27f022f" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,27bed1fc-5962-47f9-a220-bb24f27f022f.aspx</comments>
      <category>Code</category>
      <category>Mac</category>
      <category>Performance</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=679f4b61-564b-46a9-80db-78f327a17009</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,679f4b61-564b-46a9-80db-78f327a17009.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,679f4b61-564b-46a9-80db-78f327a17009.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=679f4b61-564b-46a9-80db-78f327a17009</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Well I am back in Seattle again, and it's an especially nice place to be i nthe summer
if I can get out of the office. Windows 7 is close to shipping and we've gone on a
secound round of visiting OEMs to test their images for the new flagship OS. On naked
machines the numbers are better across the board. The biggest problem now still remains
bundled software which isn't a problem per se, but when you add more software to a
machine, it has more to do, more to store, more to read so it is going to have a performance
cost. The build in WDDM drivers are quite good too for most of the hardware I've seen.
This will certainly improve as those drivers are replaced by hardware vendor specific
ones. However I think it's really cool that you can take most shake and bake laptops
or desktops, install Windows 7 on it and it just works.
</p>
        <p>
As a mac fan, I am very happy to see Windows 7 look a lot better too. It's just shinier.
The icons are bigger and higer resolution, and everything has a little candy sheen
to it. I love using Mac's, but I always come back to Windows because Entourage is
a pale shadow of Outlook, and Visual Studio is unparalleled by anything I've seen
on the Mac. Their development tools are probably excellent if you are used to their
SDK, but I'm such a .NET head now, that I can just do more faster with that SDK, so
I keep coming back to it.
</p>
        <img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=679f4b61-564b-46a9-80db-78f327a17009" />
      </body>
      <title>Windows 7 is really better!</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,679f4b61-564b-46a9-80db-78f327a17009.aspx</guid>
      <link>http://www.johnblackman.com/2009/06/22/Windows7IsReallyBetter.aspx</link>
      <pubDate>Mon, 22 Jun 2009 06:09:52 GMT</pubDate>
      <description>&lt;p&gt;
Well I am back in Seattle again, and it's an especially nice place to be i nthe summer
if I can get out of the office. Windows 7 is close to shipping and we've gone on a
secound round of visiting OEMs to test their images for the new flagship OS. On naked
machines the numbers are better across the board. The biggest problem now still remains
bundled software which isn't a problem per se, but when you add more software to a
machine, it has more to do, more to store, more to read so it is going to have a performance
cost. The build in WDDM drivers are quite good too for most of the hardware I've seen.
This will certainly improve as those drivers are replaced by hardware vendor specific
ones. However I think it's really cool that you can take most shake and bake laptops
or desktops, install Windows 7 on it and it just works.
&lt;/p&gt;
&lt;p&gt;
As a mac fan, I am very happy to see Windows 7 look a lot better too. It's just shinier.
The icons are bigger and higer resolution, and everything has a little candy sheen
to it. I love using Mac's, but I always come back to Windows because Entourage is
a pale shadow of Outlook, and Visual Studio is unparalleled by anything I've seen
on the Mac. Their development tools are probably excellent if you are used to their
SDK, but I'm such a .NET head now, that I can just do more faster with that SDK, so
I keep coming back to it.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=679f4b61-564b-46a9-80db-78f327a17009" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,679f4b61-564b-46a9-80db-78f327a17009.aspx</comments>
      <category>Code</category>
      <category>Mac</category>
      <category>Performance</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=c9fc2b1c-fab0-4fea-81e7-78610b7fac0b</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,c9fc2b1c-fab0-4fea-81e7-78610b7fac0b.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,c9fc2b1c-fab0-4fea-81e7-78610b7fac0b.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c9fc2b1c-fab0-4fea-81e7-78610b7fac0b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Everyone seems to be rather fearful of this new H1N1 virus. Some of those fears are
well founded, but a lot of them are just uneducated panic.
</p>
        <p>
So far there have been a few hundred deaths in Mexico, and several more cases are
showing up in countires all over the world. However, the death rates outside the original
infection area have been very low. To date, approximately two weeks after this whole
thing began, less than 1000 people have died from the H1N1 flu. 
</p>
        <p>
To give you some context, almost 500,000 people die from heart disease in the US annually.
You can verify this on the CDC website. The actual number is around 430,000. That's
approximately 1730 people per day, just in the US. I like to use this as my benchmark
for panic from massive deaths, as it is the leading cause of death in the United States.
So until we start loosing more than 1700 people a day from H1N1, I'm not going to
start worrying too much. 
</p>
        <p>
Oh, and about 36,000 people a year (~100 per day) die from plain old non media hyped
flu, just in the US. <a href="http://www.cdc.gov/flu/keyfacts.htm">CDC Flu Fact Sheet</a></p>
        <p>
All of that being said, the scary part of a very virulant flu is its ability to pass
from human to human and its lethality. Viruses can spread at a geometric rate and
quickly pass our magic 1700/day rate if the infection doubles every day and kills
more than 10% of its victims. However, we are not seeing anything near that with the
H1N1 virus. So wash your hands, and don't live in fear.<img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=c9fc2b1c-fab0-4fea-81e7-78610b7fac0b" /></p>
      </body>
      <title>Why you don't need to worry about swine flu... yet.</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,c9fc2b1c-fab0-4fea-81e7-78610b7fac0b.aspx</guid>
      <link>http://www.johnblackman.com/2009/05/03/WhyYouDontNeedToWorryAboutSwineFluYet.aspx</link>
      <pubDate>Sun, 03 May 2009 22:13:15 GMT</pubDate>
      <description>&lt;p&gt;
Everyone seems to be rather fearful of this new H1N1 virus. Some of those fears are
well founded, but a lot of them are just uneducated panic.
&lt;/p&gt;
&lt;p&gt;
So far there have been a few hundred deaths in Mexico, and several more cases are
showing up in countires all over the world. However, the death rates outside the original
infection area have been very low. To date, approximately two weeks after this whole
thing began, less than 1000 people have died from the H1N1 flu. 
&lt;/p&gt;
&lt;p&gt;
To give you some context, almost 500,000 people die from heart disease in the US annually.
You can verify this on the CDC website. The actual number is around 430,000. That's
approximately 1730 people per day, just in the US. I like to use this as my benchmark
for panic from massive deaths, as it is the leading cause of death in the United States.
So until we start loosing more than 1700 people a day from H1N1, I'm not going to
start worrying too much. 
&lt;/p&gt;
&lt;p&gt;
Oh, and about 36,000 people a year (~100 per day) die from plain old non media hyped
flu, just in the US. &lt;a href="http://www.cdc.gov/flu/keyfacts.htm"&gt;CDC Flu Fact Sheet&lt;/a&gt; 
&lt;p&gt;
All of that being said, the scary part of a very virulant flu is its ability to pass
from human to human and its lethality. Viruses can spread at a geometric rate and
quickly pass our magic 1700/day rate if the infection doubles every day and kills
more than 10% of its victims. However, we are not seeing anything near that with the
H1N1 virus. So wash your hands, and don't live in fear.&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=c9fc2b1c-fab0-4fea-81e7-78610b7fac0b" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,c9fc2b1c-fab0-4fea-81e7-78610b7fac0b.aspx</comments>
      <category>Hype</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=3cd07fc2-25c7-4a38-b410-6bec858a684b</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,3cd07fc2-25c7-4a38-b410-6bec858a684b.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,3cd07fc2-25c7-4a38-b410-6bec858a684b.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=3cd07fc2-25c7-4a38-b410-6bec858a684b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I just came across a great quick synopsis
of a feature coming in .NET 4.0 that will make some parallel computing in .NET much
easier using PLINQ. Here's a really great <a href="http://blogs.msdn.com/charlie/archive/2008/12/15/query-data-with-parallel-linq.aspx">blog
post</a> on it, and you can implement it in probably under 30 minutes.<img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=3cd07fc2-25c7-4a38-b410-6bec858a684b" /></body>
      <title>PLINQ and parallelism</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,3cd07fc2-25c7-4a38-b410-6bec858a684b.aspx</guid>
      <link>http://www.johnblackman.com/2008/12/29/PLINQAndParallelism.aspx</link>
      <pubDate>Mon, 29 Dec 2008 20:03:25 GMT</pubDate>
      <description>I just came across a great quick synopsis of a feature coming in .NET 4.0 that will make some parallel computing in .NET much easier using PLINQ.  Here's a really great &lt;a href="http://blogs.msdn.com/charlie/archive/2008/12/15/query-data-with-parallel-linq.aspx"&gt;blog
post&lt;/a&gt; on it, and you can implement it in probably under 30 minutes.&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=3cd07fc2-25c7-4a38-b410-6bec858a684b" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,3cd07fc2-25c7-4a38-b410-6bec858a684b.aspx</comments>
      <category>Code</category>
      <category>Performance</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=60a0ae8c-0c9e-44ce-ae42-1121911e8897</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,60a0ae8c-0c9e-44ce-ae42-1121911e8897.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,60a0ae8c-0c9e-44ce-ae42-1121911e8897.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=60a0ae8c-0c9e-44ce-ae42-1121911e8897</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
So being the greenie that I am, I looked into the Austin Energy rebate program for
solar power.  They offer a compelling rebate of $13,500 a year for every solar
system you install on your residence.  The cool part is that their fiscal year
ends September 31st, so you can apply for the 2008 and 2009 rebates within a 60 day
time span and do 2 installs to get both rebates.  I'm working with a vendor called <a href="http://www.solarcommunity.net/">Solar
Community</a>.  They're local to Austin and have installed nearly 100 systems
so far.  The remaining balance for the install after rebate can be paid for by
a 5 year loan who's payments are about equal to the energy savings provided each month
by the solar panels.  So it should pay for itself, and after the loan is gone,
you're making money.
</p>
        <p>
I will post images as the install occurs.  They should start work on it in the
second week of September.
</p>
        <img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=60a0ae8c-0c9e-44ce-ae42-1121911e8897" />
      </body>
      <title>Solar Panels</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,60a0ae8c-0c9e-44ce-ae42-1121911e8897.aspx</guid>
      <link>http://www.johnblackman.com/2008/08/23/SolarPanels.aspx</link>
      <pubDate>Sat, 23 Aug 2008 22:23:18 GMT</pubDate>
      <description>&lt;p&gt;
So being the greenie that I am, I looked into the Austin Energy rebate program for
solar power.&amp;nbsp; They offer a compelling rebate of $13,500 a year for every solar
system you install on your residence.&amp;nbsp; The cool part is that their fiscal year
ends September 31st, so you can apply for the 2008 and 2009 rebates within a 60 day
time span and do 2 installs to get both rebates.&amp;nbsp; I'm working with a vendor called &lt;a href="http://www.solarcommunity.net/"&gt;Solar
Community&lt;/a&gt;.&amp;nbsp; They're local to Austin and have installed nearly 100 systems
so far.&amp;nbsp; The remaining balance for the install after rebate can be paid for by
a 5 year loan who's payments are about equal to the energy savings provided each month
by the solar panels.&amp;nbsp; So it should pay for itself, and after the loan is gone,
you're making money.
&lt;/p&gt;
&lt;p&gt;
I will post images as the install occurs.&amp;nbsp; They should start work on it in the
second week of September.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=60a0ae8c-0c9e-44ce-ae42-1121911e8897" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,60a0ae8c-0c9e-44ce-ae42-1121911e8897.aspx</comments>
      <category>Environment</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=8e30cd69-2dc6-4cee-8938-2daa978ec46e</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,8e30cd69-2dc6-4cee-8938-2daa978ec46e.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,8e30cd69-2dc6-4cee-8938-2daa978ec46e.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=8e30cd69-2dc6-4cee-8938-2daa978ec46e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This little bit of usefulness in powershell is also available in various guides and
books, but I often find that technical documentation is written to be more complete
than practical.  I will scan a long document full of reference data to assemble
what I need to do which can really be communicated in a simple example.  So here's
a few easy ways to check to see if a registry entry exists or to look up a value. 
These are really handy for testing and auto configuring machines on your network.
</p>
        <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
          <div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"># The Test-Path cmdlet <span style="color: #0000ff">is</span> handy <span style="color: #0000ff">for</span> detecting
not only <span style="color: #0000ff">if</span> files exist <span style="color: #0000ff">in</span> the
file system, </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"># but reg key entries <span style="color: #0000ff">as</span> well</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">#</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"># $QuickLog will get a $<span style="color: #0000ff">true</span> or
$<span style="color: #0000ff">false</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">#</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">$QuickLog=(Test-Path <span style="color: #006080">'HKCU:\Software\JQL
- www.jql.co.uk\Quick Log'</span>)</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"> </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"># This returns an array of all the values at <span style="color: #0000ff">this</span> key</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">$regObj = get-item <span style="color: #006080">'HKCU:\Software\JQL
- www.jql.co.uk\Quick Log'</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"> </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"># This <span style="color: #0000ff">is</span> a
path <span style="color: #0000ff">for</span><span style="color: #0000ff">using</span> with
set-ItemProperty</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">$path = <span style="color: #006080">'HKCU:\Software\JQL
- www.jql.co.uk\Quick Log'</span></pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"> </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"># Notice we use the <span style="color: #0000ff">object</span> here</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">$keys = $regObj.GetValueNames()</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
              <span style="color: #0000ff">foreach</span>($key <span style="color: #0000ff">in</span> $keys)</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">{</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    # Do what you will with your reg keys</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
              <span style="color: #0000ff">if</span>($key.Contains(<span style="color: #006080">"Hints"</span>))</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    {</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        # Set the execution policy so we can write here</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        set-itemproperty -Path $path -Name ExecutionPolicy -Value unrestricted</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            </pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        # This assumes you have a String property</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        # Notice that we use the path and not the <span style="color: #0000ff">object</span> here</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        set-itemproperty -path $path -name $key -<span style="color: #0000ff">value</span> 0</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    }</pre>
            <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}</pre>
          </div>
        </div>
        <img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=8e30cd69-2dc6-4cee-8938-2daa978ec46e" />
      </body>
      <title>Reading the Registry with Powershell</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,8e30cd69-2dc6-4cee-8938-2daa978ec46e.aspx</guid>
      <link>http://www.johnblackman.com/2008/06/28/ReadingTheRegistryWithPowershell.aspx</link>
      <pubDate>Sat, 28 Jun 2008 19:26:11 GMT</pubDate>
      <description>&lt;p&gt;
This little bit of usefulness in powershell is also available in various guides and
books, but I often find that technical documentation is written to be more complete
than practical.&amp;#160; I will scan a long document full of reference data to assemble
what I need to do which can really be communicated in a simple example.&amp;#160; So here's
a few easy ways to check to see if a registry entry exists or to look up a value.&amp;#160;
These are really handy for testing and auto configuring machines on your network.
&lt;/p&gt;
&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;
&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;# The Test-Path cmdlet &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; handy &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; detecting
not only &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; files exist &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; the
file system, &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;# but reg key entries &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; well&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;#&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;# $QuickLog will get a $&lt;span style="color: #0000ff"&gt;true&lt;/span&gt; or
$&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;#&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;$QuickLog=(Test-Path &lt;span style="color: #006080"&gt;'HKCU:\Software\JQL
- www.jql.co.uk\Quick Log'&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;# This returns an array of all the values at &lt;span style="color: #0000ff"&gt;this&lt;/span&gt; key&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;$regObj = get-item &lt;span style="color: #006080"&gt;'HKCU:\Software\JQL
- www.jql.co.uk\Quick Log'&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;# This &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; a
path &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; with
set-ItemProperty&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;$path = &lt;span style="color: #006080"&gt;'HKCU:\Software\JQL
- www.jql.co.uk\Quick Log'&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;# Notice we use the &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; here&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;$keys = $regObj.GetValueNames()&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt;($key &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; $keys)&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;{&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    # Do what you will with your reg keys&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;($key.Contains(&lt;span style="color: #006080"&gt;&amp;quot;Hints&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    {&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;        # Set the execution policy so we can write here&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;        set-itemproperty -Path $path -Name ExecutionPolicy -Value unrestricted&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;        &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;        # This assumes you have a String property&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;        # Notice that we use the path and not the &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; here&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;        set-itemproperty -path $path -name $key -&lt;span style="color: #0000ff"&gt;value&lt;/span&gt; 0&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    }&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=8e30cd69-2dc6-4cee-8938-2daa978ec46e" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,8e30cd69-2dc6-4cee-8938-2daa978ec46e.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=9039ea7f-e2a1-4562-911f-5ce9572cfd72</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,9039ea7f-e2a1-4562-911f-5ce9572cfd72.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,9039ea7f-e2a1-4562-911f-5ce9572cfd72.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=9039ea7f-e2a1-4562-911f-5ce9572cfd72</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Oh this is hilarious.  I'm playing
with Google AdSense on my blog and it being a new generator, it has decided to place
ads for black singles based on my last name.  Now that's entertaining. 
I'm curious to see if they will hone in on something more appropriate, so bear with
my experimentation here. 
<p></p><script type="text/javascript"><!--
google_ad_client = "pub-4114422245538606";
/* 468x60, Programming */
google_ad_slot = "6038032369";
google_ad_width = 468;
google_ad_height = 60;
//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script><img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=9039ea7f-e2a1-4562-911f-5ce9572cfd72" /></body>
      <title>Google Ad Sense</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,9039ea7f-e2a1-4562-911f-5ce9572cfd72.aspx</guid>
      <link>http://www.johnblackman.com/2008/06/28/GoogleAdSense.aspx</link>
      <pubDate>Sat, 28 Jun 2008 18:35:58 GMT</pubDate>
      <description>Oh this is hilarious.&amp;nbsp; I'm playing with Google AdSense on my blog and it being a new generator, it has decided to place ads for black singles based on my last name.&amp;nbsp; Now that's entertaining.&amp;nbsp; I'm curious to see if they will hone in on something more appropriate, so bear with my experimentation here. 
&lt;p&gt;
&lt;/p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-4114422245538606";
/* 468x60, Programming */
google_ad_slot = "6038032369";
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=9039ea7f-e2a1-4562-911f-5ce9572cfd72" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,9039ea7f-e2a1-4562-911f-5ce9572cfd72.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=b6c35b81-6318-4a61-84bd-d87a3e36b1ba</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,b6c35b81-6318-4a61-84bd-d87a3e36b1ba.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,b6c35b81-6318-4a61-84bd-d87a3e36b1ba.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b6c35b81-6318-4a61-84bd-d87a3e36b1ba</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've been looking all over trying to find a smart way to create nested XML in powershell,
and after combining a few sources I have come up with something that works pretty
well.  Now I don't recommend actually doing it this way unless you have to. 
This is a fairly laborious process that I'm undertaking only because my particular
situation requires that I do not use compiled code.  A C# object model using
the Linq XML serializer is far easier, consistent, and less prone to bugs than this. 
However sometime you just have to write a hack.
</p>
        <div style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BACKGROUND-COLOR: #f4f4f4">
          <div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"># Create the results file</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$output = $args[0] + <span style="COLOR: #006080">"\results.xml"</span></pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">$outxml = New-Object <span style="COLOR: #006080">"System.Xml.XmlDocument"</span></pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$outxml.LoadXml(<span style="COLOR: #006080">"&lt;?xml
version=`"</span>1.0`<span style="COLOR: #006080">" encoding=`"</span>utf-8`<span style="COLOR: #006080">"?&gt;&lt;Results
xmlns:xsi=`"</span>http:<span style="COLOR: #008000">//www.w3.org/2001/XMLSchema-instance`"
xmlns:xsd=`"http://www.w3.org/2001/XMLSchema`"&gt;&lt;/Results&gt;")</span></pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"> </pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"># Tests</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">$elem = $outxml.CreateElement(<span style="COLOR: #006080">"Tests"</span>)</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$outxml.get_ChildNodes().Item(1).AppendChild($elem)</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"> </pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"># Test</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">$elem = $outxml.CreateElement(<span style="COLOR: #006080">"Test"</span>)</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$elem.SetAttribute(<span style="COLOR: #006080">"xsi:type"</span>,<span style="COLOR: #006080">"MemoryTest"</span>)</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">$outxml.SelectSingleNode(<span style="COLOR: #006080">"Results/Tests"</span>).AppendChild($elem)</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"> </pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"># Name</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$elem = $outxml.CreateElement(<span style="COLOR: #006080">"Name"</span>)</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">$elem.PSBase.InnerText = <span style="COLOR: #006080">"Video"</span></pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$nsMgr = New-Object System.Xml.XmlNamespaceManager($outxml.get_NameTable())</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">$nsMgr.AddNamespace(<span style="COLOR: #006080">"type"</span>, <span style="COLOR: #006080">"MemoryTest"</span>)</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$outxml.SelectSingleNode(<span style="COLOR: #006080">"Results/Tests/Test"</span>,
$nsMgr).AppendChild($elem)</pre>
          </div>
        </div>
        <p>
 
</p>
        <p>
Notice the use of the XmlNamespaceManager.  This allows you to have multiple
Test nodes within Tests each with a different type.  This makes sure you can
add elements to the right trees.  
</p>
        <p>
Again, this is the grunt work of XML serialization that lots of programmers end up
doing, but really shouldn't have to.  Go use the Linq serializer.
</p>
        <img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=b6c35b81-6318-4a61-84bd-d87a3e36b1ba" />
      </body>
      <title>Creating Nested XML in Powershell</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,b6c35b81-6318-4a61-84bd-d87a3e36b1ba.aspx</guid>
      <link>http://www.johnblackman.com/2008/06/17/CreatingNestedXMLInPowershell.aspx</link>
      <pubDate>Tue, 17 Jun 2008 04:01:53 GMT</pubDate>
      <description>&lt;p&gt;
I've been looking all over trying to find a smart way to create nested XML in powershell,
and after combining a few sources I have come up with something that works pretty
well.&amp;nbsp; Now I don't recommend actually doing it this way unless you have to.&amp;nbsp;
This is a fairly laborious process that I'm undertaking only because my particular
situation requires that I do not use compiled code.&amp;nbsp; A C# object model using
the Linq XML serializer is far easier, consistent, and less prone to bugs than this.&amp;nbsp;
However sometime you just have to write a hack.
&lt;/p&gt;
&lt;div style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BACKGROUND-COLOR: #f4f4f4"&gt;
&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;# Create the results file&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$output = $args[0] + &lt;span style="COLOR: #006080"&gt;"\results.xml"&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;$outxml = New-Object &lt;span style="COLOR: #006080"&gt;"System.Xml.XmlDocument"&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$outxml.LoadXml(&lt;span style="COLOR: #006080"&gt;"&amp;lt;?xml
version=`"&lt;/span&gt;1.0`&lt;span style="COLOR: #006080"&gt;" encoding=`"&lt;/span&gt;utf-8`&lt;span style="COLOR: #006080"&gt;"?&amp;gt;&amp;lt;Results
xmlns:xsi=`"&lt;/span&gt;http:&lt;span style="COLOR: #008000"&gt;//www.w3.org/2001/XMLSchema-instance`"
xmlns:xsd=`"http://www.w3.org/2001/XMLSchema`"&amp;gt;&amp;lt;/Results&amp;gt;")&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;# Tests&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;$elem = $outxml.CreateElement(&lt;span style="COLOR: #006080"&gt;"Tests"&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$outxml.get_ChildNodes().Item(1).AppendChild($elem)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;# Test&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;$elem = $outxml.CreateElement(&lt;span style="COLOR: #006080"&gt;"Test"&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$elem.SetAttribute(&lt;span style="COLOR: #006080"&gt;"xsi:type"&lt;/span&gt;,&lt;span style="COLOR: #006080"&gt;"MemoryTest"&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;$outxml.SelectSingleNode(&lt;span style="COLOR: #006080"&gt;"Results/Tests"&lt;/span&gt;).AppendChild($elem)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;# Name&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$elem = $outxml.CreateElement(&lt;span style="COLOR: #006080"&gt;"Name"&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;$elem.PSBase.InnerText = &lt;span style="COLOR: #006080"&gt;"Video"&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$nsMgr = New-Object System.Xml.XmlNamespaceManager($outxml.get_NameTable())&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;$nsMgr.AddNamespace(&lt;span style="COLOR: #006080"&gt;"type"&lt;/span&gt;, &lt;span style="COLOR: #006080"&gt;"MemoryTest"&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$outxml.SelectSingleNode(&lt;span style="COLOR: #006080"&gt;"Results/Tests/Test"&lt;/span&gt;,
$nsMgr).AppendChild($elem)&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Notice the use of the XmlNamespaceManager.&amp;nbsp; This allows you to have multiple
Test nodes within Tests each with a different type.&amp;nbsp; This makes sure you can
add elements to the right trees.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
Again, this is the grunt work of XML serialization that lots of programmers end up
doing, but really shouldn't have to.&amp;nbsp; Go use the Linq serializer.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=b6c35b81-6318-4a61-84bd-d87a3e36b1ba" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,b6c35b81-6318-4a61-84bd-d87a3e36b1ba.aspx</comments>
      <category>Code</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=07fee3bd-37fa-4871-aed3-d03912c8d65a</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,07fee3bd-37fa-4871-aed3-d03912c8d65a.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,07fee3bd-37fa-4871-aed3-d03912c8d65a.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=07fee3bd-37fa-4871-aed3-d03912c8d65a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">This is a nice and short talk on the emergence
of open source information, not just software, and how it is reshaping economies. 
Even though everyone is pretty well used to the internet, at least in rich industrial
nations, we are still in the very early stages of its development.  It's only
been commercially available for 15 years.  There are some great ideas in this
talk about where it might go and how it may impact industry.<br /><p></p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="VE_Player" align="middle" height="285" width="320"><param name="movie" value="http://static.videoegg.com/ted2/flash/loader.swf" /><param name="FlashVars" value="bgColor=FFFFFF&amp;file=http://static.videoegg.com/ted/movies/YochaiBenkler_2005G_high.flv&amp;autoPlay=false&amp;fullscreenURL=http://static.videoegg.com/ted/flash/fullscreen.html&amp;forcePlay=false&amp;logo=&amp;allowFullscreen=true" /><param name="quality" value="high" /><param name="allowScriptAccess" value="always" /><param name="bgcolor" value="#FFFFFF" /><param name="scale" value="noscale" /><param name="wmode" value="window" /><embed src="http://static.videoegg.com/ted2/flash/loader.swf" flashvars="bgColor=FFFFFF&amp;file=http://static.videoegg.com/ted/movies/YochaiBenkler_2005G_high.flv&amp;autoPlay=false&amp;fullscreenURL=http://static.videoegg.com/ted/flash/fullscreen.html&amp;forcePlay=false&amp;logo=&amp;allowFullscreen=true" quality="high" allowscriptaccess="always" bgcolor="#FFFFFF" scale="noscale" wmode="window" name="VE_Player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="285" width="320"></embed></object><img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=07fee3bd-37fa-4871-aed3-d03912c8d65a" /></body>
      <title>Open Source Economics</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,07fee3bd-37fa-4871-aed3-d03912c8d65a.aspx</guid>
      <link>http://www.johnblackman.com/2008/05/23/OpenSourceEconomics.aspx</link>
      <pubDate>Fri, 23 May 2008 07:14:05 GMT</pubDate>
      <description>This is a nice and short talk on the emergence of open source information, not just software, and how it is reshaping economies.&amp;nbsp; Even though everyone is pretty well used to the internet, at least in rich industrial nations, we are still in the very early stages of its development.&amp;nbsp; It's only been commercially available for 15 years.&amp;nbsp; There are some great ideas in this talk about where it might go and how it may impact industry.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="VE_Player" align="middle" height="285" width="320"&gt;
&lt;param name="movie" value="http://static.videoegg.com/ted2/flash/loader.swf"&gt;
&lt;param name="FlashVars" value="bgColor=FFFFFF&amp;amp;file=http://static.videoegg.com/ted/movies/YochaiBenkler_2005G_high.flv&amp;amp;autoPlay=false&amp;amp;fullscreenURL=http://static.videoegg.com/ted/flash/fullscreen.html&amp;amp;forcePlay=false&amp;amp;logo=&amp;amp;allowFullscreen=true"&gt;
&lt;param name="quality" value="high"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;
&lt;param name="bgcolor" value="#FFFFFF"&gt;
&lt;param name="scale" value="noscale"&gt;
&lt;param name="wmode" value="window"&gt;&lt;embed src="http://static.videoegg.com/ted2/flash/loader.swf" flashvars="bgColor=FFFFFF&amp;amp;file=http://static.videoegg.com/ted/movies/YochaiBenkler_2005G_high.flv&amp;amp;autoPlay=false&amp;amp;fullscreenURL=http://static.videoegg.com/ted/flash/fullscreen.html&amp;amp;forcePlay=false&amp;amp;logo=&amp;amp;allowFullscreen=true" quality="high" allowscriptaccess="always" bgcolor="#FFFFFF" scale="noscale" wmode="window" name="VE_Player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="285" width="320"&gt;
&lt;/object&gt;&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=07fee3bd-37fa-4871-aed3-d03912c8d65a" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,07fee3bd-37fa-4871-aed3-d03912c8d65a.aspx</comments>
      <category>Future</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=de182eaf-5431-4386-b26c-c24db9fad577</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,de182eaf-5431-4386-b26c-c24db9fad577.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,de182eaf-5431-4386-b26c-c24db9fad577.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=de182eaf-5431-4386-b26c-c24db9fad577</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just found this great new blog for efficient and power concious living.  Check
it out.
</p>
        <p>
          <a href="http://www.metaefficient.com/">http://www.metaefficient.com/</a>
        </p>
        <img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=de182eaf-5431-4386-b26c-c24db9fad577" />
      </body>
      <title>Meta Efficient</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,de182eaf-5431-4386-b26c-c24db9fad577.aspx</guid>
      <link>http://www.johnblackman.com/2008/05/21/MetaEfficient.aspx</link>
      <pubDate>Wed, 21 May 2008 18:11:02 GMT</pubDate>
      <description>&lt;p&gt;
I just found this great new blog for efficient and power concious living.&amp;nbsp; Check
it out.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.metaefficient.com/"&gt;http://www.metaefficient.com/&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=de182eaf-5431-4386-b26c-c24db9fad577" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,de182eaf-5431-4386-b26c-c24db9fad577.aspx</comments>
      <category>Environment</category>
    </item>
    <item>
      <trackback:ping>http://www.johnblackman.com/Trackback.aspx?guid=83f20c78-a59e-4c87-95ba-b0bda0ae069c</trackback:ping>
      <pingback:server>http://www.johnblackman.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnblackman.com/PermaLink,guid,83f20c78-a59e-4c87-95ba-b0bda0ae069c.aspx</pingback:target>
      <dc:creator>John S Blackman</dc:creator>
      <wfw:comment>http://www.johnblackman.com/CommentView,guid,83f20c78-a59e-4c87-95ba-b0bda0ae069c.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnblackman.com/SyndicationService.asmx/GetEntryCommentsRss?guid=83f20c78-a59e-4c87-95ba-b0bda0ae069c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
So I've recently had the task of fetching some information out of system.nfo files
to translate cryptic IDs numbers into human readable friendly names.  This is
the thing that XML is supposed to excel at right?  Well you would think that
task would be simple enough, and as it turns out it is.  However searching for
this solution online proved to be difficult, so I'm going to retell my experience
here in hopes that it might help anyone else with this problem out.
</p>
        <p>
I started with what I thought was a nice elegant powershell script that would query
the XML like a SQL DB and return my value.  Seems simple enough right?
</p>
        <div style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BACKGROUND-COLOR: #f4f4f4">
          <div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">
              <p>
$friendlyName = $sysinfo.MsInfo.Category.Category.Category.Data.DeviceName | <span style="COLOR: #0000ff">where</span> {$sysinfo.MsInfo.Category.Category.Category.Data.Device_ID
-eq $global:deviceName} 
</p>
              <p>
 
</p>
            </pre>
          </div>
        </div>
        <p>
This would work with normal XML where your content is inside the XML tags.  However
the system.nfo file uses CDATA objects and many nests of categories so you have to
go one step further.  Since I don't know which Category sub-tree my offending
device or data might be in, I ended up grabbing all of the data objects that met my
criteria and doing a breadth first search.  Sounds ugly compared to the one liner
up there, but it actually works and don't take that long.  The following code
is in powershell.  The key here is that handy get_innertext() method.  Your
standard .Value or .Text won't cut it with CDATA.
</p>
        <div style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BACKGROUND-COLOR: #f4f4f4">
          <div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"># Open the associated .nfo file</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$sysinfo_file = $global:computer_name + <span style="COLOR: #006080">".nfo"</span></pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">$sysinfo_path = $global:computer_name + <span style="COLOR: #006080">"\"
+ $sysinfo_file
</span></pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">[xml]$sysinfo = get-content $sysinfo_path</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"> </pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$nodeList1 = @($sysinfo.GetElementsByTagName("Device_Name<span style="COLOR: #006080">"))
</span></pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">$nodeList2 = @($sysinfo.GetElementsByTagName("Device_ID<span style="COLOR: #006080">"))
</span></pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$nodeList3 = @($sysinfo.GetElementsByTagName("Manufacturer"))</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"> </pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">$i = 0</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">
              <span style="COLOR: #0000ff">foreach</span>($node <span style="COLOR: #0000ff">in</span> $nodeList2)</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">{</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">    $deviceID = $nodeList2[$i].get_innertext()</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">
              <span style="COLOR: #0000ff">if</span>($deviceID
-eq $global:device_name)</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">    {</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">        $friendlyName = $nodeList1[$i].get_innertext()</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">        $deviceManuf = $nodeList3[$i].get_innertext()</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">    }</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none">    $i++</pre>
            <pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">}</pre>
          </div>
        </div>
        <p>
The purpose of this handy little script is to look up a cryptic device ID and return
a friendly manufacturers name.
</p>
        <img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=83f20c78-a59e-4c87-95ba-b0bda0ae069c" />
      </body>
      <title>Powershell CDATA XML GET</title>
      <guid isPermaLink="false">http://www.johnblackman.com/PermaLink,guid,83f20c78-a59e-4c87-95ba-b0bda0ae069c.aspx</guid>
      <link>http://www.johnblackman.com/2008/05/14/PowershellCDATAXMLGET.aspx</link>
      <pubDate>Wed, 14 May 2008 17:20:06 GMT</pubDate>
      <description>&lt;p&gt;
So I've recently had the task of fetching some information out of system.nfo files
to translate cryptic IDs numbers into human readable friendly names.&amp;nbsp; This is
the thing that XML is supposed to excel at right?&amp;nbsp; Well you would think that
task would be simple enough, and as it turns out it is.&amp;nbsp; However searching for
this solution online proved to be difficult, so I'm going to retell my experience
here in hopes that it might help anyone else with this problem out.
&lt;/p&gt;
&lt;p&gt;
I started with what I thought was a nice elegant powershell script that would query
the XML like a SQL DB and return my value.&amp;nbsp; Seems simple enough right?
&lt;/p&gt;
&lt;div style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BACKGROUND-COLOR: #f4f4f4"&gt;
&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;
&lt;p&gt;
$friendlyName = $sysinfo.MsInfo.Category.Category.Category.Data.DeviceName | &lt;span style="COLOR: #0000ff"&gt;where&lt;/span&gt; {$sysinfo.MsInfo.Category.Category.Category.Data.Device_ID
-eq $global:deviceName} 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
This would work with normal XML where your content is inside the XML tags.&amp;nbsp; However
the system.nfo file uses CDATA objects and many nests of categories so you have to
go one step further.&amp;nbsp; Since I don't know which Category sub-tree my offending
device or data might be in, I ended up grabbing all of the data objects that met my
criteria and doing a breadth first search.&amp;nbsp; Sounds ugly compared to the one liner
up there, but it actually works and don't take that long.&amp;nbsp; The following code
is in powershell.&amp;nbsp; The key here is that handy get_innertext() method.&amp;nbsp; Your
standard .Value or .Text won't cut it with CDATA.
&lt;/p&gt;
&lt;div style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BACKGROUND-COLOR: #f4f4f4"&gt;
&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;# Open the associated .nfo file&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$sysinfo_file = $global:computer_name + &lt;span style="COLOR: #006080"&gt;".nfo"&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;$sysinfo_path = $global:computer_name + &lt;span style="COLOR: #006080"&gt;"\"
+ $sysinfo_file
&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;[xml]$sysinfo = get-content $sysinfo_path&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$nodeList1 = @($sysinfo.GetElementsByTagName("&gt;Device_Name&lt;span style="COLOR: #006080"&gt;"))
&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;$nodeList2 = @($sysinfo.GetElementsByTagName("&gt;Device_ID&lt;span style="COLOR: #006080"&gt;"))
&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$nodeList3 = @($sysinfo.GetElementsByTagName("&gt;Manufacturer"))&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;$i = 0&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #0000ff"&gt;foreach&lt;/span&gt;($node &lt;span style="COLOR: #0000ff"&gt;in&lt;/span&gt; $nodeList2)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;{&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    $deviceID = $nodeList2[$i].get_innertext()&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;    &lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt;($deviceID
-eq $global:device_name)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        $friendlyName = $nodeList1[$i].get_innertext()&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        $deviceManuf = $nodeList3[$i].get_innertext()&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;    }&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    $i++&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
The purpose of this handy little script is to look up a cryptic device ID and return
a friendly manufacturers name.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.johnblackman.com/aggbug.ashx?id=83f20c78-a59e-4c87-95ba-b0bda0ae069c" /&gt;</description>
      <comments>http://www.johnblackman.com/CommentView,guid,83f20c78-a59e-4c87-95ba-b0bda0ae069c.aspx</comments>
      <category>Code</category>
    </item>
  </channel>
</rss>