CimPSDrive icon indicating copy to clipboard operation
CimPSDrive copied to clipboard

Allow discovery of classes recursively without looking for instances

Open HemantMahawar opened this issue 8 years ago • 2 comments

One should be able to do:

PS> dir CIM:\localhost *PRINTER* -recurse

This works today but the problem is that it enumerates all the instance directories so it takes forever.

  • Implement a dynamic parameter that tells only looks for a CLASS and to ignore the instances.

HemantMahawar avatar Nov 14 '17 17:11 HemantMahawar

I think this should be the default behavior. I was surprised to see instances. While useful and not a big deal if a user stumbles across win32_bios, not so great if they come across something like win32_product or Win32_directory.

jdhitsolutions avatar Nov 14 '17 22:11 jdhitsolutions

Taking this a step further, if the default is to NOT provide instances, as long as I get the relevant namespace and class information I can pipe my current location to Get-CimInstance.

image

Personally, I'm good with this approach.

jdhitsolutions avatar Nov 14 '17 22:11 jdhitsolutions