Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of a Datum handler that can reference another datum based on its path (rough and dirty)
function Invoke-TestHandlerAction {
Param(
$Password,
$test,
$Datum,
$Node,
$InputObject
)
@"
Action: $handler
InputObject: $InputObject
Node: $($Node|FL *|Out-String)
Params:
$($PSBoundParameters | Convertto-Json)
"@ | Write-Verbose
$datumLink = [regex]::Matches($InputObject,"^\[TEST=(?<data>[\w\W]*)\]$")[0].groups['data'].value -split '\\'
[scriptblock]::Create("`$Datum.$($datumLink -join '.')").Invoke()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment