Classes and DSC
Classes in PowerShell exist because of Desired State Configuration (DSC). DSC resources written as PowerShell classes are very succinct; they avoid the repetition inherent in script-based resources. Script-based resources must at least duplicate the param block. Class-based resources also avoid the need for a separately generated schema document and have a simpler module layout.
Class-based DSC resources in a module must be explicitly exported using the DscResourcesToExport key in a module manifest document.
The class must include a DscResource attribute. Each property a user is expected to set must have a DscProperty attribute. At least one property must be the Key property of the DscProperty attribute set. The class must ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access