>I have a collection of collections I need to iterate over: $_.Data |%{ Match,
>then break }
>
>Problem is return/continue do not end the final iteration of objects, how does
>one effectively
>accomplish this? $_.Data is actually a collection itself from a larger
>collection? Once I
>match, there is no point in continuing to look, but the scope of break still
>appears global
>so the script halts?
I rectified this with a Where-Object and 'Select -First 1'
$_.Data |?{ $_."#text" -iMatch $Filter } |
Select -First 1 |Out-Null
<Increment totals...>
Not so sure this the best way, but it works...
jlc
~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~
---
To manage subscriptions click here:
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin