基于类的 DSC 资源Class-based DSC Resources

使用类定义 DSC 资源Defining DSC resources with classes

根据反馈,我们已简化了编写基于类的 DSC 资源的操作,并且内容更易于理解。Based on feedback, we’ve made authoring class-based DSC resources simpler and easier to understand. 基于类的 DSC 资源和 cmdlet DSC 资源提供程序之间的主要区别如下:The major differences between a class-based DSC resource and a cmdlet DSC resource provider are:

  • 架构的 MOF 文件不是必需的。A MOF file for the schema is not required.
  • 模块文件中的 DSCResource 子文件夹不是必需的。A DSCResource subfolder in the module folder is not required.
  • PowerShell 模块文件可以包含多个 DSC 资源类。A PowerShell module file can contain multiple DSC resource classes.

有关详细信息,请参阅使用 PowerShell 类编写自定义 DSC 资源For more information, see Writing a custom DSC resource with PowerShell classes.