function Demonstrate-Pipeline
{
[OutputType([Nullable])]
param([parameter(mandatory, valueFromPipeline, valueFromPipelineByPropertyName)][string]$ReportName)
begin {
write-host "Beginning"
}
process {
write-host "Processing $ReportName"
}
end {
write-host "Finishing"
}
}
'Lodestar Accruals Report Summary', 'Lodestar Accruals Report Details', 'Lodestar Shipping Margin Summary', 'Foodstuffs Accruals Details' | % { Demonstrate-Pipeline $_ }
'Lodestar Accruals Report Summary', 'Lodestar Accruals Report Details', 'Lodestar Shipping Margin Summary', 'Foodstuffs Accruals Details' | Demonstrate-Pipeline