internal/functions/flowcontrol/Invoke-SteppablePipeline.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function Invoke-SteppablePipeline {
    <#
    .SYNOPSIS
        Allows using steppable pipelines on the pipeline.
 
    .DESCRIPTION
        Allows using steppable pipelines on the pipeline.
 
    .PARAMETER InputObject
        The object(s) to process
        Should only receive input from the pipeline!
 
    .PARAMETER Pipeline
        The pipeline to execute
 
    .EXAMPLE
        PS C:\> Get-ChildItem | Invoke-SteppablePipeline -Pipeline $steppablePipeline
 
        Processes the object returned by Get-ChildItem in the pipeline defined
    #>

    [CmdletBinding()]
    param (
        [Parameter(ValueFromPipeline)]
        $InputObject,

        [Parameter(Mandatory)]
        $Pipeline
    )

    process {
        $Pipeline.Process($InputObject)
    }
}