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!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.