# Hashtable driving me mad.

**URL:** <https://forums.powershell.org/t/hashtable-driving-me-mad/8650>\
**Category:** PowerShell Help\
**Created:** [May 18, 2017, 4:33am UTC](https://forums.powershell.org/t/hashtable-driving-me-mad/8650 "2017-05-18T04:33:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![incognitotom](https://avatars.discourse-cdn.com/v4/letter/i/e495f1/32.png) [@incognitotom](https://forums.powershell.org/u/incognitotom)\
**Post date:** [May 18, 2017, 4:33am UTC](https://forums.powershell.org/t/hashtable-driving-me-mad/8650/1 "2017-05-18T04:33:13Z")

</div>

Hi,

Please can someone help, for some reason when i run the following code to output values in a hashtable, the output is being grouped, but if i remove the 4th item in the hashtable, the output is in a list format.

I need the output for the 4 items to be in list not grouped.

```
Foreach($Vm in $WAPVMs){
Get-WAPackVM -Name $VM.Name | Select-Object Name, @{Name=“CPU”;Expression={$_.CPUCount}},
                                                             @{Name=“Memory”;Expression={$_.Memory}},
                                                             @{Name=“DiskSzie”;Expression={$_.TotalSize / 1GB}},
                                                             @{Name=“OS”;Expression={$_.OperatingSystem}}
                                                            

}
```

OutPut with 4 items:

```
Name : ServerName
CPU : 2
Memory : 4096
DiskSzie : 14.919921875
OS : Windows Server 2012 R2 Standard
```

Output with 3 Items

```
Name CPU Memory DiskSzie
---- --- ------ --------
ServeName 2 8192 30.3701171875 14.4
```

What am i doing wrong?

thanks

TommyQ

---

<div class="post-metadata">

**Author:** ![atkinsroy](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/atkinsroy/32/26_2.png) [@atkinsroy](https://forums.powershell.org/u/atkinsroy)\
**Post date:** [May 18, 2017, 4:59am UTC](https://forums.powershell.org/t/hashtable-driving-me-mad/8650/2 "2017-05-18T04:59:47Z")

</div>

Nothing at all. By default PowerShell displays objects with 4 or fewer properties as a table, 5 or more in a list. Without doing more advanced stuff, you can just pipe the output of you select-object command to Format-List to get the results you want.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:38pm UTC](https://forums.powershell.org/t/hashtable-driving-me-mad/8650/3 "2024-05-16T20:38:45Z")

</div>


