Skip to content

Conversation

@MathiasVP
Copy link
Collaborator

This PR implements flow from pipeline arguments to ValueFromPipelineByPropertyName parameters. For example:

function Process-Input {
    Param([Parameter(ValueFromPipelineByPropertyName)] $x)
    Sink $x
}

$x = Get-TaintedData
[pscustomobject]@{x = $x} | Process-Input

This is fairly simple given the machinery from #119, #121, and #122:

  1. From PS: Flow through hash table creation, reads, and writes #121 we get flow from $x to @{x = $x} with a store step that remembers that x is tainted.
  2. From PS: Flow through conversions #122 there is a flow step from @{x = $x} to [pscustomobject]@{x = $x}
  3. From PS: Flow through pipelines #119 we get flow from [pscustomobject]@{x = $x} and into the pipeline parameter in Process-Input

Now, the only thing this PR has to do is to change which parameter receives this flow, and provide a read step that reads x out of the parameter node ... and that's exactly what we do 😄

@MathiasVP MathiasVP merged commit bfa9210 into main Oct 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants