Status update … I’m working through issues with the RootConfiguration.ps1 that you have. The issue is that it doesn’t just work for me when I just run it (maybe I’m doing it wrong):
configuration RootConfig {
Import-DscResource -ModuleName PSDesiredStateConfiguration
# Import-DscResource -ModuleName SharedDscConfig -ModuleVersion 0.0.3
# Import-DscResource -ModuleName Chocolatey -ModuleVersion 0.0.46
Node $ConfigurationData.AllNodes.NodeName {
(Lookup 'Configurations').Foreach{
$ConfigurationName = $_
$Properties = $(lookup $ConfigurationName -DefaultValue @{})
Get-DscSplattedResource -ResourceName $ConfigurationName -ExecutionName $ConfigurationName -Properties $Properties
}
}
}
$Environment = 'DEV'
$Datum = New-DatumStructure -DefinitionFile "${PSScriptRoot}\Datum.yml"
$RootConfig = @{
'ConfigurationData' = @{
'AllNodes' = @($Datum.AllNodes.($Environment).PSObject.Properties | ForEach-Object {
$Node = $Datum.AllNodes.($Environment).($_.Name)
$Node.Add('Environment', $Environment)
if(!$Node.Contains('Name') ) {
$Node.Add('Name', $_.Name)
}
(@{} + $Node)
});
'Datum' = $Datum
}
'Out' = "${PSScriptRoot}\BuildRoot\BuildOutput\MOF\"
}
Write-Verbose "RootConfig: $($RootConfig | ConvertTo-Json -Depth 3)"
RootConfig @RootConfig
Doing that, I get the following error:
PSDesiredStateConfiguration\node : The lookup returned a Null value, but Null is not specified as Default. This is not allowed.
It looks to me like it doesn’t like the Lookup command, so I confirmed:
PS > $Datum = New-DatumStructure -DefinitionFile "Datum.yml"
PS > Lookup 'Configurations'
WARNING: No Datum store found for DSC Resource
The lookup returned a Null value, but Null is not specified as Default. This is not allowed.
At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.30\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
+ throw "The lookup returned a Null value, but Null is not spec ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (The lookup retu...is not allowed.:String) [], RuntimeException
+ FullyQualifiedErrorId : The lookup returned a Null value, but Null is not specified as Default. This is not allowed
.
Alright, so how about this:
PS C:\Users\VertigoRay\CloudStation\Temp\Git\ECS> Lookup 'Configurations' -DatumTree $Datum
Shared1
SoftwareBase
Much better. So, I tweaked that line to look like this:
(Lookup 'Configurations' -DatumTree $ConfigurationData.Datum).Foreach{
Now, I get a different error:
VERBOSE: Result found for Configurations
PSDesiredStateConfiguration\Node : The term 'Shared1' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
Now, I need to do some includes. It’s taking me a bit to get my head wrapped around things cause … well … definitely need more documentation.