PowerShell filter vs. function
- by Marcel Janus
I'm reading currently the Windows PowerShell 3.0 Step by Step book to get some more insights to PowerShell.
On page 201 the author demonstrates that a filter is faster than the function with the same functionally.
This script takes 2.6 seconds on his computer:
MeasureaddOneFilter.ps1
Filter AddOne
{
"add one filter"
$_ + 1
}
and this…