I watched Gael Colas’ presentations which can be found on Youtube,
and I am very convinced that it is a very usefull module when working with DSC.
However, I am not able to use Datum correctly.
I’ve created a little structure with 2 nodes and 2 roles just to play arround and be able to manage the basics.
PS> (Get-ChildItem -Recurse).FullName E:\dsc\ConfigurationData\AllNodes E:\dsc\ConfigurationData\Roles E:\dsc\ConfigurationData\Datum.yml E:\dsc\ConfigurationData\AllNodes\v-Computer1.yml E:\dsc\ConfigurationData\AllNodes\v-Computer2.yml E:\dsc\ConfigurationData\Roles\FileServer.yml E:\dsc\ConfigurationData\Roles\WebServer.yml
Based on what I found on the Datum’s Github page, I’ve filled the files and here is the content
PS> Get-ChildItem *.yml -Recurse | ForEach-Object {"`n`r$($_.FullName)"; Get-Content -Path $_.FullName}
E:\dsc\ConfigurationData\AllNodes\v-Computer1.yml
Name: v-Computer1
IP: '10.0.0.11'
Role: FileServer
E:\dsc\ConfigurationData\AllNodes\v-Computer2.yml
Name: v-Computer2
IP: '10.0.0.12'
Role: WebServer
E:\dsc\ConfigurationData\Roles\FileServer.yml
WindowsFeatureList:
- FS-FileServer
- FS-Data-Deduplication
E:\dsc\ConfigurationData\Roles\WebServer.yml
WindowsFeatureList:
- Web-WebServer
E:\dsc\ConfigurationData\Datum.yml
ResolutionPrecedence:
- AllNodes\$($Node.Name)
- Roles\$($Node.Role)
Now creating the Datum variable
$datum = New-DatumStructure -DefinitionFile .\Datum.yml
Looking inside the variable
PS> $datum
Name Value
---- -----
__Definition {ResolutionPrecedence, DatumStructure}
Roles FileProvider
AllNodes FileProvider
PS> $datum.Roles
FileServer WebServer
---------- ---------
{WindowsFeatureList} {WindowsFeatureList}
PS> $datum.AllNodes
v-Computer1 v-Computer2
----------- -----------
{Name, IP, Role} {Name, IP, Role}
PS> $datum.AllNodes.'v-Computer1'
Name Value
---- -----
Name v-Computer1
IP 10.0.0.11
Role FileServer
So far so good!
However, I am not able to make the lookup working…
PS> Lookup WindowsFeatureList
WARNING: No Datum store found for DSC Resource
The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
+ throw "The lookup of path '$PropertyPath' for node '$($node.N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
+ FullyQualifiedErrorId : The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
PS> Lookup -DatumTree $datum -Node v-Computer1 -PropertyPath WindowsFeatureList
WARNING: No Datum store found for DSC Resource
The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
+ throw "The lookup of path '$PropertyPath' for node '$($node.N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
+ FullyQualifiedErrorId : The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
PS> Lookup -DatumTree $datum -Node v-Computer1 -PropertyPath Name
WARNING: No Datum store found for DSC Resource
The lookup of path 'Name' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
+ throw "The lookup of path '$PropertyPath' for node '$($node.N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
+ FullyQualifiedErrorId : The lookup of path 'Name' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
PS> Lookup -DatumTree $datum -Node v-Computer1 -PropertyPath IP
WARNING: No Datum store found for DSC Resource
The lookup of path 'IP' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
+ throw "The lookup of path '$PropertyPath' for node '$($node.N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
+ FullyQualifiedErrorId : The lookup of path 'IP' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
If someone could save me from tearing my hair out of my head… ![]()