private/Invoke-WpcPipeline.ps1
|
function Invoke-WpcPipeline { param($value, [string] $pipeline) if ([string]::IsNullOrWhiteSpace($pipeline)) { return $value } if (Get-Command 'Expand-PlaceholderPipelineRec' -ErrorAction SilentlyContinue) { $pipelineStr = $pipeline.Trim() if (-not $pipelineStr.StartsWith('|')) { $pipelineStr = "| $pipelineStr" } return Expand-PlaceholderPipelineRec -value $value -pipeline $pipelineStr } $funcName = ($pipeline -replace '^\s*\|\s*', '').Trim() -replace '\(.*\)$', '' return Invoke-PlaceholderFunction -inputValue $value -functionName $funcName -extraArgs @() } |