Forum Discussion

AlainKlein's avatar
AlainKlein
Copper Contributor
Nov 18, 2020

Accented characters lost when calling Microsoft Graph from Powershell script

Hi,

 

I wrote a script to create, update or delete contacts in one of my Exchange contacts folder by using Invoke-RestMethod cmdlet to call Microsoft Graph API.

The issue is that accented characters are replaced with the Unicode replacement character (a black diamond with a white question mark) in contacts properties where such accented characters should be displayed.

 

For instance when updating jobTitle property with characters 'éçèà', I get four replacement characters as shown in the attached file.

 

I tried with :

- PowerShell ISE 5.1

- PowerShell 7.0.3 terminal

- VS Code 1.50.1 with Powershell Extension 2020.6.0

- PowerShell within Azure Function

 

Calling Microsoft Graph API with some other API specialized software is successful : the accented characters get displayed in the Exchange contacts properties.

 

I'm a beginner in PowerShell scripting and with all aspects of using .Net functionalities.

 

Thanks for your help.

Resources