Skip to content

Command Build DatumConfiguration

Michael Zanatta edited this page Sep 16, 2026 · 1 revision

Build-DatumConfiguration

Synopsis

Function to compile the Datum configuration.

Description

The Build-DatumConfiguration function clears the specified output directory, imports necessary modules, changes the current directory to the configuration path, creates a new Datum structure from a definition file, tests the configuration, and resolves each project node using the Resolve-DscDatumProject function. The function runs the script block in a separate thread.

Parameters

Name Type Required Description
OutputPath String Yes The path to the output directory where the compiled configuration will be stored. This parameter is mandatory and must be a valid directory path.
ConfigurationPath String Yes The path to the configuration directory containing the Datum definition file. This parameter is mandatory and must be a valid directory path.
AllowedRoot String No Undocumented.
SourceIsRemote SwitchParameter No Undocumented.

Examples

Example 1

Build-DatumConfiguration -OutputPath "C:\Output" -ConfigurationPath "C:\Configuration"
This example clears the output directory at "C:\Output", imports necessary modules, changes the directory to "C:\Configuration",
creates a new Datum structure from the Datum.yml file, tests the configuration, and resolves each project node.

Notes

The function uses runspaces to run the script block in a separate thread. Ensure that the 'powershell-yaml', 'datum', and 'datum.invokecommand' modules are available.

Caller contract (#26): the compile step is the module-internal function 'DatumConfigurationScriptBlock' (source/Private/Configuration/DatumConfigurationScriptBlock.ps1). It is resolved by name via Get-Command, so it must be loaded in the session — which it is whenever Dsc.PipelineRunner is imported as a module. Tests that dot-source this function in isolation must therefore also provide a 'DatumConfigurationScriptBlock' function (the existing Pester suite defines a stub), otherwise the Get-Command lookup fails.

Clone this wiki locally