Wednesday, November 4, 2015

Working with Collections in PowerShell

If you have to work with Collections in PowerShell, you basically have 3 major options:

  1. Arrays
  2. ArrayLists
  3. Hashtables
Arrays are definitely the most common collections used in PowerShell scripts since they are built directly into the PowerShell framework and are by far the easiest to use:

Hashtables are similar to Dictionary collections and are also built directly into the PowerShell framework:

ArrayLists are NOT built into the PowerShell framework, but instead uses the capabilities of the .NET Framework in order to provide this functionality:  However, given that you can tap into nearly any library that is provided by the .NET Framework using PowerShell, you could also potentially tap into Queues and Stacks as well! 

To learn more about Collections that are available with the .NET Framework, you can check out these articles:

No comments:

Post a Comment