Let's assume the following Dictonary:
$Grid = [System.Collections.Generic.Dictionary[[System.String],[System.Boolean]]]::new()
For ( $i = 0; $i -lt 10; $i++ ) {
For ( $j = 0; $j -lt 10; $j++ ) {
$Grid.Add("$i,$j", $false)
}
}
That makes a 10x10 "Grid" with some sort of Coordinates:
0,0 = False
0,1 = False
0,2 = False
and so on.
I am able to set a range of them to a specific value:
$Grid['0,0', '0,1', '0,2'] = $true
But i can't get it to work to toggle the actual value.
What i try to accomplish is something like
$Grid['0,0', '0,1', '0,2'] = -Not $_.Value
Any help is highly appreciated! - Thanks in advance!
EDIT:
You're NOT able to assign a value to a range of indices in the way i wrote. Please have a look at this answer from mklement0 for more details.