DscTagging tags DSC nodes with metadata about the current configuration, including version, environment, and module information.
Use this resource when you need to track which DSC configuration version, environment, and role is applied to each node. It stores metadata in registry entries and environment variables, enabling reporting, inventory, and troubleshooting across your managed infrastructure.
Source |
|
DSC Resource |
|
Documentation |
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
Version |
Mandatory |
System.Version |
DSC configuration version |
|
BuildNumber |
Int |
Build number of the DSC configuration |
||
Environment |
Mandatory |
String |
DSC environment information |
|
NodeVersion |
String |
Optional node specific DSC configuration version |
||
NodeRole |
String |
Role of the node |
||
DisableGitCommitId |
Boolean |
Disable export of git commit id |
|
|
Layers |
String[] |
List of used layers (YAML files) for each node |
|
Note
|
To fill the |
Datum.yml (Excerpt)ResolutionPrecedence:
- AllNodes\$($Node.Environment)\$($Node.NodeName)
- Environment\$($Node.Environment)
- Roles\$($Node.Role)
- Roles\ServerBaseline
lookup_options:
# merge rules of DscTagging - using Add to identify duplicate module names
DscTagging:
merge_hash: deep
DscTagging\Modules:
merge_basetype_array: AddAllNodes\MyComputer.yml (Excerpt)NodeName: MyComputer
Environment: Dev
Role: FileServer
MyVersion: 1.1Environment\Dev.yml (Excerpt)DscTagging:
Environment: Dev
# use Datum.InvokeCommand to get the role name and version of the current node
NodeRole: '[x={ $node.Role }=]'
NodeVersion: '[x={ $node.MyVersion }=]'
Layers:
- Environment\DevRoles\FileServer.yml (Excerpt)DscTagging:
Layers:
- Roles\FileServerRoles\ServerBaseline.yml (Excerpt)Configurations:
- DscTagging
DscTagging:
Version: 0.3.0
Layers:
- Roles\ServerBaselineMyComputer.yml (Excerpt)Configurations:
- DscTagging
DscTagging:
Version: 0.3.0
Environment: Dev
NodeRole: FileServer
NodeVersion: 1.1
Layers:
- Environment\Dev
- Roles\FileServer
- Roles\ServerBaseline