I have written a PowerShell script in Azure serverless that returns some html
when using the script from Firefox or Chrome, the transmitted html document is opened in the browser as expected, but when using Microsoft's browsers Edge or Internet Explorer, the transmitted html document is downloaded as a file which absolutely is not what we want.
I have tried to modify the content disposition without success.
What should I modify in the script to get IE and Edge to properly show the html content?
here is a part of the code that makes the html document.
foreach ($container in $containers | Sort-Object -Property Name -Descending )
{
$uri = "list?name=$($container.Name)"
$HTML += "<li><a href=`"$($uri)`">$($container.Name)</a></li>"+ "`r`n"
}
$HTML += "</ul>"+ "`r`n"
$HTML += " </body></html>"
$status = [HttpStatusCode]::OK
$body = $HTML
# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = $status
Body = $body
headers = @{'content-type'='text\html'}
})