Issue with output of Powershell function
<p>I'm writing a function and observing some unusual behavior with the output.</p>

<p>This is the code:</p>

<pre><code>Function Get-CompInfo
{
    [Cmdletbinding()]
    PARAM 
    (
        [Parameter(ValueFromPipeline=$true)]
        [Alias('Comp', 'Host')]
        [string[]]$computername
    )


    Begin
    {

    }
    Process
    {
        if ($computername -eq $Null) {
                $computername=$env:computername
                $VerboseOut="No computer specified. Running against local computer $computername :"
        }
            Else {
                $VerboseOut="Getting information for computer $computername :"
        }
        Write-Verbose $VerboseOut
        $CompInfo=Get-WmiObject Win32_Computersystem -computername $computername 
        $OSInfo=Get-WmiObject Win32_OperatingSystem -computername $computername 
                $Properties = [ordered]@{
                'Input'=$computername
                'SystemName'=$CompInfo.Name
                'Manufacturer'=$CompInfo.Manufacturer
                'Model'=$CompInfo.Model
                'PhysicalMemory'=$CompInfo.TotalPhysicalMemory
                'LogicalProcessors'=$CompInfo.NumberOfLogicalProcessors
                'OSCaption'=$OSInfo.Caption
                'OSArchitecture'=$OSInfo.OSArchitecture
                'ServicePackMajorVersion'=$OSInfo.ServicePackMajorVersion}

        # Output Information
        $obj=New-Object -TypeName PSobject -Property $Properties
        write-output $obj 

    }
    End
    {

    }
}
</code></pre>

<p>When passing parameters from the pipline:</p>

<p><strong>"karuma", "localhost" | Get-CompInfo</strong></p>

<pre><code>Input                   : {karuma}
SystemName              : KARUMA
Manufacturer            : Hewlett-Packard
Model                   : h9-1400a
PhysicalMemory          : 17115000832
LogicalProcessors       : 8
OSCaption               : Microsoft Windows 10 Pro
OSArchitecture          : 64-bit
ServicePackMajorVersion : 0

Input                   : {localhost}
SystemName              : KARUMA
Manufacturer            : Hewlett-Packard
Model                   : h9-1400a
PhysicalMemory          : 17115000832
LogicalProcessors       : 8
OSCaption               : Microsoft Windows 10 Pro
OSArchitecture          : 64-bit
ServicePackMajorVersion : 0
</code></pre>

<p>I get the same kind of output when I pass a text file with a list of computer names.</p>

<p>When specifying multiple host names something different:</p>

<p><strong>Get-CompInfo -computername localhost, karuma</strong></p>

<pre><code>Input                   : {localhost, karuma}
SystemName              : {KARUMA, KARUMA}
Manufacturer            : {Hewlett-Packard, Hewlett-Packard}
Model                   : {h9-1400a, h9-1400a}
PhysicalMemory          : {17115000832, 17115000832}
LogicalProcessors       : {8, 8}
OSCaption               : {Microsoft Windows 10 Pro, Microsoft Windows 10 Pro}
OSArchitecture          : {64-bit, 64-bit}
ServicePackMajorVersion : {0, 0} 
</code></pre>

<p>I'm expecting to see table output when passing multiple values as would by seen by piping to format-table.</p>

<p>Any help on what I need to change to get the output as desired would be appreciated.</p>