I am trying to retrieve an array and at the end I want to put all of them as a list into an hash, but I get only index and not the list of values.
$testArray = [System.Collections.ArrayList]@()
$tempArray = "123", "321", "453"
foreach($item in $tempArray) {
if ($item -notlike 123) {
$arrayID = $testArray.Add($item);
}
}
@{"mailboxes" = $arrayID};
As a result I would like to see values like
mailboxes {321, 453}
instead of index like below.
mailboxes 1
@{"mailboxes" = $arrayID}->@{"mailboxes" = $testArray}