Returning ÆØÅ through API

I have an Endpoint that simply returns data from Get-ADuser, when running it with

Invoke-RestMethod https://beta.middlewaredashboard.domain/ADQuery/AllEmployees/something or
Invoke-RestMethod https://beta.middlewaredashboard.domain/ADQuery/AllEmployees/something -ContentType 'application/json; charset=utf-8'

it returns gibberish in place of ÆØÅ characters.

Any tips on getting it to return the data properly encoded?

Product: PowerShell Universal
Version: 2.7.3

Seems to work for me. Are you testing in Windows PowerShell? I see issues displaying those chars when using Invoke-RestMethod in WinPS.

image

image

interesting, yes I was testing in WinPS.

In case it is helpful, I published an informal function intended only for Windows PowerShell 5.1 to workaround this specific scenario here

2 Likes