WMI SUPERCLASS reference using Powershell

Welcome Forums General PowerShell Q&A WMI SUPERCLASS reference using Powershell

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
2 years, 3 months ago.

  • Author
    Posts
  • #58727

    Participant
    Points: 0
    Rank: Member

    Hi friends,

    I'm developing a WMI subclass and I would like to reference a superclass to my subclass.

    I know the MOF code is:

    class MySubClass : __Superclass

    How can I do the same using Powershell?

    My PS code is:

    $NewClass = New-Object System.Management.ManagementClass ("root\MySubClass", "root\MySubClass\__Superclass", $null);
    $NewClass['__CLASS'] = "MySubClass"
    $NewClass.Properties.Add('Name', [System.Management.CimType]::String, $false)
    $NewClass.Properties['Name'].Qualifiers.Add('Key', $true)

    Thanks

    Tavares

  • #58732

    Participant
    Points: 1,164
    Helping Hand
    Rank: Community Hero

    Don't you think it's pretty unpolite to not to wait for an answer? You literally posted this question parrallel in two forums at the same time. :-/ HELP!!! How to do a WMI SUPERCLASS reference using POWERSHELL

    • #58741

      Participant
      Points: 0
      Rank: Member

      Hi Olaf,

      I'm sharing a question with the community not to wait a final answer, but to exchange experiences and new view points to maybe solve a problem. Experts from both foruns can sharing their knowledge.

      Thank you for your feedback.

The topic ‘WMI SUPERCLASS reference using Powershell’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort