r/PowerShell • u/Defiant_Wafer5282 • 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
20
Upvotes
View all comments
Show parent comment
1
u/TofuBug40 Apr 06 '26
You can even notice that switching to using the Property parameter set vs the FilterScript parameter set has a not insiginficant difference.
This can and does scale out even worse when you are dealing with pulling data from systems that might be separated by geographic locations or network distance. You quickly start to notice your previously speedy approaches dragging to a crawl.
It also brings up another possibility and really the correct answer in these cases filter BEFORE not after. Almost every system that is designed to be queried, File systems, Active Directory, SQL, etc has means to give IT your filter and IT does the filtering where it lives where it has all the cores and memory and disk space to literally fly through that filter and then as an additional bonus it has LESS data it needs to send you back.
So the final test I ran didn't even use where of any kind it just added the
-Filter '*.txt'parameter to the otherwise unchangedGet-ChildItemsplat. For that we getNearly twice as fast in this example just by filtering first.
Code blocks as promised