Search notes:

PowerShell: filter

A filter is a function that just has a process block.
The following two command are equivalent:
filter twice {
    2 * $_
}

function times_two {
    param(
        [parameter(mandatory, valueFromPipeline)]
        [int] $num
    )

    process {
        2 * $num
    }
}
These commands can be invoked in a pipeline like so:
7,21,48 | twice
8,24,11 | times_two

Index