New MPToolComputerRoleClass - AndreasSobczyk/MPTool GitHub Wiki

#New-MPToolComputerRoleClass

Creates a new class from the base class Microsoft.Windows.ComputerRole. Adds the needed references for the base class automatically. Returns object of type [Microsoft.EnterpriseManagement.Configuration.ManagementPackClass]

###Parameters

  • ManagementServerFQDN [string] – (Optional) FQDN of the management server to connect.
  • ManagementPackName [string] – (Optional) Name of the management pack.
  • ClassName [string] – (Optional) Name of the new class.
  • ClassDisplayName [string] – (Optional) Display name of the new class.
  • ClassDescription [string] – (Optional) Description of the new class.
  • ClassKeyProperties [array] – (Optional) Array of key properties for the new class. Usually only one key property.
    Example - @("KeyProp")
  • ClassNonKeyProperties [array] – (Optional) Array of non-key properties for the new class.
    Example - @("Prop1","Prop2")
  • IsAbstract [boolean] – (Optional) Abstract setting for the class $true / $false. Default is $false
  • IsSingleton [boolean] – (Optional) Singleton setting for the class $true / $false. Default is $false

###Example Creates a new abstract class named "Contoso. ComputerRole", with one key property "KeyProp" and two non-key properties "Prop1" and "Prop2", in the management pack " Contoso.Monitoring "

New-MPToolApplicationComponentClass -ManagementServerFQDN scom01.contoso.com `
-ManagementPackName "Contoso.Monitoring" `
-ClassName "Contoso.ComputerRole" `
-ClassDisplayName "Contoso ComputerRole" `
-ClassDescription "Class to Contoso.ComputerRole" `
-ClassKeyProperties @("KeyProp") `
-ClassNonKeyProperties @("Prop1","Prop2") `
-IsAbstract $true `
-IsSingleton $false