Forum

Some collections can't be used with Foreach Loop

I’m trying to emulate this piece of code:

image
but the ManagementObjectCollection that results from s.Get() can’t be spliced. How can I adapt this collection?

you could try an OfType in between… it seems to be a non generic sequence.

1 Like

Yep, nailed it. Thanks!