@PS Thanks for reaching out. Can you please confirm if you are running the powershell script in Azure function? In case if it is Azure function then you need to leverage Push-OutputBinding as documented here.
$out = Invoke-AzVMRunCommand -ComputerName $HybridEndpoint `
-Scriptstring $Script
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [System.Net.HttpStatusCode]::OK
Body = "$out"
})
{
"bindings": [
{
"type": "httpTrigger",
"direction": "in",
"authLevel": "anonymous"
},
{
"type": "http",
"direction": "out",
"name": "Response"
}
]
}