Pode icon indicating copy to clipboard operation
Pode copied to clipboard

`Write-PodeHtmlResponse` returns the wrong result when an array of strings is piped.

Open mdaneri opened this issue 10 months ago • 0 comments

Describe the Bug

Write-PodeHtmlResponse returns the wrong result when an array of strings is piped. It works correctly if the array is passed as a parameter.

Steps To Reproduce

Steps to reproduce the behavior:

Add-PodeRoute -Path '/processesPipedNotWorking'  -Method Get -ScriptBlock {
        Get-Process | .{ process { if ($_.WS -gt 100mb) { $_ } } } |
            Select-Object Name, @{e = { [int]($_.WS / 1mb) }; n = 'WS' } |
            Sort-Object WS -Descending | Write-PodeHtmlResponse  -StatusCode 200
    }

This bug has been discovered during the resolution of #1257

Target Pode version 2.11.0

mdaneri avatar Mar 29 '24 22:03 mdaneri