Попробуйте что-то вроде этого:
PS> $ht = @{user1=,'Group2';user2='Group1','Group2','Group3';
user3='Group3','Group4'}
PS> $ht.GetEnumerator() |
Foreach {$obj = new-object psobject -prop @{col1=$_.Name}; $_.Value |
Foreach {$i=2} `
{Add-Member NoteProperty "col$i" $_ -Inp $obj; $i++} {$obj} } |
Sort {$_.psobject.properties.count} -desc | ConvertTo-Csv -NoTypeInformation
"col1","col2","col3","col4"
"user2","Group1","Group2","Group3"
"user1","Group2",,
"user3","Group3","Group4",