Update existing value in PowerShell Array

I have some functions that can be used to find an array index and then update a specific value in that array. However, let’s say you don’t want to use a function and instead only want to update a value once.

This command can be used to search for a multi-dimensional array row by a column value and then update another column in that row.

 

To simply return a single row of an array, simple run this, being sure to modify the search value:
$ArrayName.Rows | Where-Object {$_.column -eq "Search_Value"}

Leave a Reply

Your email address will not be published.