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 implement the Get, Set, and Test methods.
Class-based resources may use inheritance to simplify an implementation as required; this is especially...