Pode
Pode copied to clipboard
`Write-PodeHtmlResponse` returns the wrong result when an array of strings is piped.
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