Home Dashboard Directory Help
Search

CIM Methods are hard to discover by Keith Hill MVP


Status: 

Active


11
0
Sign in
to vote
Type: Suggestion
ID: 791819
Opened: 6/28/2013 4:17:53 PM
Access Restriction: Public
0
Workaround(s)
view

Description

Folks are so conditioned to using Get-Member to discover properties and methods on types that it is a bit unnerving to not find methods on CIM instances with Get-Member. It is also unintuitive IMO to have to use this:

Get-CimClass Win32_Process | % CimClassMethods

... to find CIM methods when Get-Member will happily show CIM properties. It would be nice to have Get-Member recognize CIM instances and display CIM methods perhaps with a special notion (CimMethod) so we know that we have to use Invoke-CimMethod to invoke that particular method. Another option is to add a new Get-CimMember cmdlet that is the CIM oriented equivalent of Get-Member.
Details
Sign in to post a comment.
Posted by Trevor Sullivan [MVP] on 8/14/2013 at 1:16 PM
I have brought this up in the past with Ed Wilson. I'm very disappointed that method binding has disappeared with the new CIMCmdlets, as it defeats the whole element of "discoverability."

Although Keith has a good recommendation to build some sort of "special" functionality into Get-Member, to recognize CIM instances, I would strongly recommend against an entirely separate, and "special" Get-CimMember command. The whole point of Get-Member is that it's the SINGLE go-to place to "get members." If the product starts deviating away from that concept, it's going to be much harder for people to keep track of "which Get-Member" to use based on the circumstances.
Sign in to post a workaround.