-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Datum.InvokeCommand v0.4.1
Here you will find all the information you need to make use of the Datum.InvokeCommand module, including details of the functions that are available, current capabilities and known issues, and information to help plan a Datum-based DSC implementation using dynamic command execution.
Please leave comments, feature requests, and bug reports in the issues section for this module.
Datum.InvokeCommand is a handler module for the Datum configuration management framework. It enables dynamic PowerShell command execution and string expansion directly within YAML configuration data files used for PowerShell Desired State Configuration (DSC).
- Invoke-InvokeCommandAction: The primary action handler invoked by the Datum framework. It evaluates embedded commands (script blocks and expandable strings) within Datum configuration values.
-
Test-InvokeCommandFilter: The filter function called by Datum's
ConvertTo-Datumon every value during data resolution. Returns$truewhen a value contains an embedded command that should be processed by the handler.
To get started, download Datum.InvokeCommand from the
PowerShell Gallery
and then unzip it to one of your PowerShell modules folders
(such as $env:ProgramFiles\WindowsPowerShell\Modules).
To install from the PowerShell Gallery using PowerShellGet (in PowerShell 5.0), run the following command:
Find-Module -Name Datum.InvokeCommand -Repository PSGallery | Install-ModuleOr with PowerShellGet v3+:
Install-PSResource -Name Datum.InvokeCommandTo confirm installation, run the below command and ensure you see the Datum.InvokeCommand functions available:
Get-Command -Module Datum.InvokeCommand- PowerShell 4.0 or later (Windows PowerShell or PowerShell 7+)
- Datum module (0.40.0 or later recommended)
-
Register the handler in your
Datum.ymlconfiguration file:DatumHandlers: Datum.InvokeCommand::InvokeCommand: SkipDuringLoad: true
-
Use embedded commands in your YAML configuration files:
# Script block NodeName: '[x={ $Node.Name }=]' # Expandable string Description: '[x= "$($Node.Role) in $($Node.Environment)" =]'
-
Resolve the configuration:
Import-Module -Name datum Import-Module -Name Datum.InvokeCommand $datum = New-DatumStructure -DefinitionFile .\DscConfigData\Datum.yml $rsop = Get-DatumRsop -Datum $datum -AllNodes $allNodes
For a detailed walkthrough, see the Getting Started guide.
- Getting Started ? Step-by-step tutorial for new users.
- Architecture ? Internal processing pipeline, module components, and error handling strategy.
- Troubleshooting ? Common issues, diagnostic steps, and resolution guidance.
A full list of changes in each version can be found in the change log.