For the better part of the 2020 I've been using a
defaults resource within my DSC modules as outlined in
THIS
post. This suddenly stopped working, failing with the error that the
DSC Resource DomainControllerCommonDefaults wasn't available. Looking at the exported
activities within the module listed in Azure Automation showed that
the resource was not being exported.
To work around this issue, I created a dedicated
WindowsDefaults module which has a dedicated DSC resource
for each of the group of default settings I use. The folder structure
is the same as in the previous post, but we now need to import the
Defaults modules in configuration files.
Folder layout:
PRIVATE.DSC.WINDOWS.DEFAULTS
| PRIVATE.DSC.Windows.DEFAULTS.psd1
|
\---DSCResources |
+---DomainControllerCommonDefaults
| DomainControllerCommonDefaults.psd1
| DomainControllerCommonDefaults.schema.psm1
|
+---FileServerCommonDefaults
| FileServerCommonDefaults.psd1
| FileServerCommonDefaults.schema.psm1
|
+---WindowsServerCommonDefaults
| WindowsServerCommonDefaults.psd1
| WindowsServerCommonDefaults.schema.psm1
|
+---WebServerCommonDefaults
| WebServerCommonDefaults.psd1
| WebServerCommonDefaults.schema.psm1
|
+---WindowsCommonDefaults
| WindowsCommonDefaults.psd1
| WindowsCommonDefaults.schema.psm1
Then in our configuration files we import the defaults composite
resource with
Import-DSCResource -ModuleName 'PRIVATE.DSC.WINDOWS.DEFAULTS'
and then don't need to update the actual defaults settings in the
configuration file.