Weird Format-Table problem

Hello all,

I’ve googled a ton and I’m not getting any further, so time to ask for help.

Let’s say I have an object and this is the return:

PS C:UsersIAADADocuments> $variable

Name Value

a {blah, blah, blah, blah, blah, …}

b {blah, blah, blah, blah, blah, …}

c {blah, blah, blah, blah, blah, …}

I’m attempting to output columns for each name and have their values below like so:
















$table = @()

ForEach($key in $variable){

For($i=0;$i -lt $key.count;$i ++){

$objPSCustom = New-Object PSObject

$objPSCustom | add-member -name “$.key” -value “$key.value[$i]”

$table += $objPSCustom



When I return $table, it only prints the data for the first key? But if I query that data directly it returns the correct information?!

PS C:UsersIAADADocuments> $table[561]




I’m at a serious loss here. Any takers?

submitted by /u/wingsndonuts
[link] [comments]

Leave a Reply