Thread: Processing XML
View Single Post
Old 10-21-2008   #4 (permalink)
Jacob


 
 

Re: Processing XML

Thanks guys that did the trick.
--
**********************
Jacob



"Hal Rottenberg [MVP]" wrote:
Quote:

> RickB wrote:
Quote:

> > $validNodes|%{$t=$_.Path;$_.User|write-host $t,$_}
> >
> > The key to nesting foreach pipelines (i.e. pipelines with %{}) is to
> > store the $_ value (or the part of it you need) in a temp variable
> > before creating the nested one. It's also possible to access the
> > parent scope of $_ but I usually consider that just too messy to
> > bother with.
>
> Or you can use Foreach-the-Statement (not foreach-object-the-cmdlet):
>
> foreach ( $node in $validNodes ) { $node.User | % { $node.Path, $_ } }
>
> is one example...
>
> --
> $signature = "Hal Rottenberg, MVP - Admin Frameworks"
> $projects = @{ title = "Blog Author"; url = "http://halr9000.com" },
> @{ title = "Co-host"; url = "http://powerscripting.net" },
> @{ title = "Community Director"; url = "http://PowerShellCommunity.org" },
> @{ title = "Psi Webmaster"; url = "http://psi-im.org" }
>
My System SpecsSystem Spec