Behind the PowerShell Pipeline logo

Behind the PowerShell Pipeline

Subscribe
Archives
May 24, 2022

Arrays and Collections

I do not doubt that you have used arrays in your PowerShell work. You might have created an array to hold the results of a PowerShell command at the console or used on in your PowerShell scripting. I often refer to an array as a collection of things which is mostly accurate. However, there is a technical distinction that I am paying more attention to these days. This distinction provides valuable performance benefits or flexibility I can’t get from a traditional array in certain situations. I don’t mean to imply that you should stop using arrays, but there may be a better alternative. Let’s take a look.

Basic Arrays

You have most likely used arrays in PowerShell like this.

Want to read the full issue?
GitHub Bluesky LinkedIn About Jeff
Powered by Buttondown, the easiest way to start and grow your newsletter.