Create Powershell Array

      No Comments on Create Powershell Array

I looked for a while to find a simple way to create a powershell array that was more than a list; I’m talking multi-dimensional. For my own reference, here’s the easiest way I’ve found so far:

To go one step further, adding rows can be simplified by using this function:

To add a row with the function, just provide values in the proper order:
Add-ArrayRow "1" "ValueName" "Some other notes."

Add-ArrayRow

If you require to update existing values in an array, see this post on Updating Existing Powershell Array values.

Leave a Reply

Your email address will not be published.