Cannot list methods of SMS_BaseClass with gwmi

This topic contains 2 replies, has 2 voices, and was last updated by  Anshul Srivastava 4 years, 7 months ago.

  • Author
  • #11377

    Anshul Srivastava


    Get-CimClass list methods for SMS_BaseClass
    PS C:\> get-cimclass -Namespace root/sms/site_ -Class sms_objectcontaineritem | select -ExpandProperty cimclassmethods

    Name ReturnType Parameters Qualifiers
    —- ———- ———- ———-
    MoveMembers SInt32 {ContainerNodeID, InstanceKeys, O... {deprecated, Description, impleme...
    MoveMembersEx SInt32 {ContainerNodeID, InstanceKeys, O... {Description, implemented, static}

    But is there anyway get-wmiobject could do that ?

    (gwmi -Namespace root/sms/site_ -Class sms_objectcontaineritem | gm -MemberType Method) – does not list methods as above.

    I tried -view base,full,adapted extended..with above command no luck.

  • #11378

    Dave Wyatt

    Are these static methods of the class? If so, you can add the -List switch to your call to Get-WmiObject, which causes it to return a ManagementClass object instead of some number of ManagementObject objects.

    gwmi -Namespace root/sms/site_ -Class sms_objectcontaineritem -List | gm -MemberType Method
  • #11379

    Anshul Srivastava

    Yes they are.Thanks 🙂

You must be logged in to reply to this topic.