PowerShell where-object query on large datasets
The last few weeks I had to create a few PowerShell scripts where I had to combine certain information from several sources.
The way I used to do it was to do a where-object on an ID in an array. This works well, but I noticed that on large datasets it takes a lot of time. A where-object on a dataset of 30.000 items it takes on average between 1 and 2 seconds. So if we do the math 2 seconds on 30.000 items costs in total 60.000 seconds (16 hours) just doing the where-object.
For me, this was the first time on a big event speaking and was a bit excited on doing this. After just a few minutes it felt good and had a great presentation with good feedback from the audience.