DSCResources/cEXOOutboundConnector/cEXOOutboundConnector.schema.psm1

configuration cEXOOutboundConnector {
    param (
        [Parameter()]
        [hashtable[]]
        $Items
)

<#
EXOOutboundConnector [String] #ResourceName
{
    Identity = [string]
    [AccessTokens = [string[]]]
    [AllAcceptedDomains = [bool]]
    [ApplicationId = [string]]
    [CertificatePassword = [PSCredential]]
    [CertificatePath = [string]]
    [CertificateThumbprint = [string]]
    [CloudServicesMailEnabled = [bool]]
    [Comment = [string]]
    [ConnectorSource = [string]{ Default | HybridWizard | Migrated }]
    [ConnectorType = [string]{ OnPremises | Partner }]
    [Credential = [PSCredential]]
    [DependsOn = [string[]]]
    [Enabled = [bool]]
    [Ensure = [string]{ Absent | Present }]
    [IsTransportRuleScoped = [bool]]
    [ManagedIdentity = [bool]]
    [PsDscRunAsCredential = [PSCredential]]
    [RecipientDomains = [string[]]]
    [RouteAllMessagesViaOnPremises = [bool]]
    [SenderRewritingEnabled = [bool]]
    [SmartHosts = [string[]]]
    [TenantId = [string]]
    [TestMode = [bool]]
    [TlsDomain = [string]]
    [TlsSettings = [string]{ CertificateValidation | DomainValidation | EncryptionOnly }]
    [UseMXRecord = [bool]]
    [ValidationRecipients = [string[]]]
}
 
#>



    Import-DscResource -ModuleName PSDesiredStateConfiguration
    Import-DscResource -ModuleName Microsoft365DSC

    $dscResourceName = 'EXOOutboundConnector'

    $param = $PSBoundParameters
    $param.Remove("InstanceName")

    $dscParameterKeys = 'Identity' -split ', '

        foreach ($item in $Items)
        {
            if (-not $item.ContainsKey('Ensure'))
            {
                $item.Ensure = 'Present'
            }
            $keyValues = foreach ($key in $dscParameterKeys)
        {
            $item.$key
        }
        $executionName = $keyValues -join '_'
        $executionName = $executionName -replace "[\s()\\:*-+/{}```"']", '_'
        (Get-DscSplattedResource -ResourceName $dscResourceName -ExecutionName $executionName -Properties $item -NoInvoke).Invoke($item)
    }
}