I have a collection of Objects with NoteProperties. One of these properties is an array. I would like to have an easy way to display the members of this noteproperty not just '[System.Object]' when I use ConvertTo-HTML.
For example, I have a property called "Computername" and one called "Disks" that is actually an array of all Disks of that computer. The output of ConvertTo-HTML looks like this:
Computername Disks
fs System.Object[]
dc1 System.Object[]
Is there an easy way to display the members of "Disks" without manually creating the html-output?
Edit:
One Disk-object has actually 3 values (name, capacity and free space) that have to be shown too.
The output of $collection[0].Disks on the powershell prompt could look like this (depending on the disks-count and so on):
PS > $collection[0].Disks
Bezeichnung Kapazität (MB) Freier Speicher (MB)
----------- -------------- --------------------
C:\ 40963 23040 (56 %)
D:\ 184324 39024 (21 %)
E:\ 204805 103373 (50 %)
I was thinking about something like a tree that shows the computername first and then a table of all disks of that computer. Something like (could be more beautiful ;)):
Computername
fs
Bezeichnung Kapazität (MB) Freier Speicher (MB)
----------- -------------- --------------------
C:\ 40963 23040 (56 %)
D:\ 184324 39024 (21 %)
E:\ 204805 103373 (50 %)
dc1