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

20 Upvotes

49 comments sorted by

View all comments

Show parent comment

1

u/TofuBug40 Apr 06 '26

There is another option that blows all of these previous methods away. Filter BEFORE you get your data instead of after like we are doing now. Then you get something like

Ran 10 tests for PreFilter.
Results:
Count : 10
Average : 22.34616977
Sum :
Maximum : 22.5040598
Minimum : 22.2449309
Property : TotalSeconds

That's almost twice as fast as all our previous attempts. What did we do? dropped the where and handed Get-ChildItem -Filter '*.txt' instead.

Most EVERY system designed to be queried for data be it file systems, active directory, SQL, etc have mechanisms built in to accept a filter from you where it takes that onto its own server where it has all the processors memory disk space etc to FLY through filtering the data and as a bonus has LESS DATA to send back to you. So everyone wins your script gets faster the load on the endpoint is lower.