Author Posts

July 12, 2013 at 12:52 pm

Here is my code:


[xml]$a = get-content c:\file.xml

Using the above code, I can now select specific parts of that xml file.  I do this as follows:

$a.books.author.name

That gives me a list of everything from the name tag.

Now I can do this

$a.books.author.date

Obviously that gives me everything in the date tag.

I need to combine these together so that I can pipe them to out-gridview using the -multi parameter.  When the end user clicks on a row in out-gridview, I'm going to need to do something with just part of that selection.  So for example, out-gridview would open and show a Name column and a Date column.  The end user would click on a row and then click on OK.  When they click OK, I need to take $a.books.author.date for the row they selected and for now just output it to the console with write-host.

I'm stuck on how to do this.

July 12, 2013 at 5:07 pm

Looks like I had to walk away from the computer and come back to it.  So for anyone else that might be having an encounter with the brain lapse, here is the code.

[xml]=$a get-content c:\file.xml

$a.books.author | select name,date