I have a command Get-Testdata that retrieves test data from different sources and stores these into a PSObject with the different values as properties. The total number of objects are then stored as an array, for easy manipulation, sorting, calculating etc.

My problem is that I want to be able to present this data as (color-coded) HTML, for which I've written another command, Show-TestResults. The input parameter looks like this

[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
[PSObject[]]$InputObject

UPDATE 1

This function itself is very basic, it simply sets some parameters for ConvertTo-HTML and then pipe the objects into that command:

$head = "<style>[...]" #styling with javascript etc
$header = "<H1>Test Results</H1>
$title = "Test results"
$InputObject | ConvertTo-HTML -head $head -body $header -title $title | Out-File $Filename

END UPDATE 1

However, when I try to use the ValueFromPipeline property, using the call

Get-Testdata [...] | Show-TestResults 

only the first object in the array is shown. But if I instead call the command like

$td = Get-Testdata [...]
Show-TestResults $td 

The whole array is presented, as expected. Can someone explain this - and hopefully guide me into correcting it?

Edit
Report