Created
November 7, 2018 09:49
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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