在 powershell DSC 资源声明中,声明的语法元素是什么?

In a powershell DSC resource declaration, what syntactical element is the declaration?

我正在尝试找出用于 Powershell DSC 资源声明的语法元素。例如:

    SqlServerNetwork "RDBMS"
    {
        DependsOn = @("[SqlSetup]RDBMS")
        InstanceName = "MSSQLSERVER"
        ProtocolName = "tcp"
        IsEnabled = $true
        TCPPort = 1433
        RestartService = $true 
    }

两个大括号之间(包括在内)的语法块到底是什么?它不是哈希表(没有 @)也不是脚本块(因为它会使属性成为 Powershell 语句)。感觉像是资源的参数,所以我想了解语法。

我找不到任何明确的参考,但我认为整个 SqlServerNetwork "RDBMS" { … } 是动态关键字声明,{ … } 是 "properties"。

如果您在此处查看 PowerShell 解析器的源代码:

https://github.com/PowerShell/PowerShell/blob/720e842c86722e9fb51e191c39bd8307d79da11a/src/System.Management.Automation/engine/parser/Parser.cs#L3579

有这条评论:

///     keyword [parameters] [name] { a=1; b=2; } # constructor with properties

在 xml 注释中 DynamicKeywordStatementRule 函数,与 DSC 块的语法匹配。

如果是这样,DynamicKeywordStatementAst 的参考资料在这里:

https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.language.dynamickeywordstatementast?view=pscore-6.0.0

这是我所能得到的。希望其他人可以提供更多细节。