cScom.psm1

enum Ensure
{
    Present
    Absent
}

# Support for DSC v3, for what it's worth
class Reason
{
    [DscProperty()]
    [string] $Code
  
    [DscProperty()]
    [string] $Phrase
}





[DscResource()]
class ScomManagementPack
{
    [DscProperty(Key)] [System.String] $Name
    [DscProperty(Mandatory)] [System.Management.Automation.PSCredential] $SCOMAdminCredential
    [DscProperty(Mandatory)] [System.String] $SourceFilePath
    [DscProperty()] [Ensure] $Ensure = 'Present'
    [DscProperty(NotConfigurable)] [Reason[]] $Reasons

    [ScomManagementPack] Get()
    {
        
        return @{
            Name = $this.Name
            SCOMAdminCredential = $this.SCOMAdminCredential
            SourceFilePath = $this.SourceFilePath
            Ensure = $this.Ensure
            Reasons = @{
                Code = 'ScomManagementPack:ScomManagementPack:ManagementPackMissing'
                Phrase = "Management pack $($this.Name) missing."
            }
        }
    }

    [void] Set()
    {

    }

    [bool] Test()
    {
        return $true
    }
}

[DscResource()]
class ScomManagementServer
{
    [DscProperty(Key)] [ValidateSet('yes')] [string] $IsSingleInstance
    [DscProperty(Mandatory)] [string] $SourcePath
    [DscProperty(Mandatory)] [System.String] $ManagementGroupName
    [DscProperty(Mandatory)] [System.Boolean] $IsFirstManagementServer
    [DscProperty(Mandatory)] [System.Management.Automation.PSCredential] $DataReader
    [DscProperty(Mandatory)] [System.Management.Automation.PSCredential] $DataWriter
    [DscProperty(Mandatory)] [System.String] $SqlServerInstance
    [DscProperty(Mandatory)] [System.String] $DwSqlServerInstance
    [DscProperty()] [Ensure] $Ensure = 'Present'
    [DscProperty()] [System.Management.Automation.PSCredential] $SetupCredential
    [DscProperty()] [System.String] $ProductKey
    [DscProperty()] [System.String] $InstallPath = 'C:\Program Files\SCOM'
    [DscProperty()] [System.UInt16] $ManagementServicePort = 5723
    [DscProperty()] [System.Management.Automation.PSCredential] $ActionAccount
    [DscProperty()] [System.Management.Automation.PSCredential] $DASAccount
    [DscProperty()] [System.String] $DatabaseName = "OperationsManager"
    [DscProperty()] [System.UInt16] $DatabaseSize = 1000
    [DscProperty()] [System.String] $DwDatabaseName = "OperationsManagerDW"
    [DscProperty()] [System.UInt16] $DwDatabaseSize = 1000
    [DscProperty()] [System.Byte] $UseMicrosoftUpdate
    [DscProperty()] [System.Byte] $SendCEIPReports
    [DscProperty()] [ValidateSet("Never", "Queued", "Always")] [System.String] $EnableErrorReporting = "Never"
    [DscProperty()] [System.Byte] $SendODRReports
    [DscProperty(NotConfigurable)] [Reason] $Reason

    [ScomManagementServer] Get()
    {
        return @{}
    }

    [void] Set()
    {

    }

    [bool] Test()
    {
        return $false
    }
}