Skip to content

Instantly share code, notes, and snippets.

@gaelcolas
Created November 7, 2018 09:49
Show Gist options
  • Save gaelcolas/b76a33b308884ff8ab43ea9ad969b126 to your computer and use it in GitHub Desktop.
Save gaelcolas/b76a33b308884ff8ab43ea9ad969b126 to your computer and use it in GitHub Desktop.
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