New MPToolLocalApplicationClass - AndreasSobczyk/MPTool GitHub Wiki

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

###Parameters

  • ManagementServerFQDN [string] – FQDN of the management server to connect.
  • ManagementPackName [string] – Name of the management pack.
  • ClassName [string] – 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.LocalApp", with one key property "KeyProp" and two non-key properties "Prop1" and "Prop2", in the management pack "Contoso.Monitoring"

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