Closed AdeeelAsif closed 2 weeks ago
Set-PodeCache is not working as expected with a piped array. When I try to retrieve the cache value using Get-PodeCache, it only shows me the last value of the array, not the entire array.
Set-PodeCache
Get-PodeCache
Steps to reproduce the behavior:
$test = $backendAddressPools | ForEach-Object { $fqdn = $.BackendAddresses.Fqdn $namespace = "Prd1" # Par défaut $health = $backendHealth | Where-Object { $.Address -eq $fqdn } | Select-Object -ExpandProperty Health if ($health -notmatch "Unknown") { [PSCustomObject]@{ AppGWName = $AppGwName BackendName = $.Name provisioningstate = $.ProvisioningState fqdn = $_.BackendAddresses.Fqdn namespace = $namespace health = $health date = get-date } } } $test | Set-PodeCache -Key "AppGateway.$($AppGwName)" -Ttl 300 Write-PodeJsonResponse -Value @($test)
The problem does not occur when using -InputObject instead of piping the array.
-InputObject
Resolved via #1388
Describe the Bug
Set-PodeCache
is not working as expected with a piped array. When I try to retrieve the cache value usingGet-PodeCache
, it only shows me the last value of the array, not the entire array.Steps To Reproduce
Steps to reproduce the behavior:
The problem does not occur when using
-InputObject
instead of piping the array.