r/PowerShell • • Apr 04 '26

Powershell Noob

Hey all

I’m a slight newbie and landed a JR infrastructure engineer role that includes looking after cloud environments, patching software and machines.

Is there any advice where I could get into learning more powershell scripting or and decent YouTube courses I could follow

Any help is appreciated

21 Upvotes

49 comments sorted by

View all comments

Show parent comment

1

u/thehuntzman Apr 06 '26

Way to be pedantic for zero reason whatsoever. The point I was trying to illustrate is that pipelines in general are slower given their nature using "where()" as a example (yes as you pointed out there are exceptions) but if your whole object is already in memory, then using a method to filter it vs the pipeline is always faster. Yes also to your point, pre-filtering your data is always most efficient if the source cmdlet supports it. I hope typing multiple posts worth of semi-relevant information while claiming I don't "understand my tools" made you feel smarter than everybody else for a moment though.

1

u/TofuBug40 Apr 07 '26

Call it pedantic if you want, but precision is exactly what someone new to PowerShell needs. The pipeline isn't just a performance knob to avoid. Understanding when it shines and when it doesn't is a foundational skill. If OP internalizes "pipelines are always slower" as a blanket rule, they're going to fight the language instead of work with it, and that's a painful habit to unlearn.

I'm not saying .Where() has no place, clearly it does. I use it along with .ForEach() all the time especially to turn it into special modes with WhereOperatorSelectionMode Skip, First, Last, even my personal favorite Split to dump me out a perfect separation of the matches and misses. But that said so does Where-Object, and the benchmarks show why. Blanket statements without context don't help beginners, they just give them confident-sounding misconceptions to repeat.