I tried a few options to iterate my directories and get a huge performance difference between the following commands:
Slow:
Get-ChildItem -Directory -Force -Recurse -Depth 3 -Include '$tf'
Fast:
Get-ChildItem -Directory -Force -Recurse -Depth 3 | Where-Object Name -eq '$tf'
Could someone explain me why the first statement is much slower than the second?