powershelloutlookoffice365exchange-server

Losing vowel mutations in Powershell type convertion


So I have an outlook signature template file (.htm) if I want to add the signature to O365 via powershell with: Set-MailboxMessageConfiguration -signatureHTML <STRING>

-signatureHTML expects a string, but if I use -signature HTML (Get-Content -Path C:\mysignature.htm) it doesn't work because the Datatype returned of Get-Content is an Array (GetType() confirmed that for me)

It WORKS if I declare a new variable [string]$htmcontent = (Get-Content -Path C:\mysignature.htm) BUT here comes my problem: In Germany we use ÜÄÖ,öäü or ß, after converting the htm-file into the string-datatype an "Ä" becomes a "ü" and so on.

Any idea how I can fix that? Appreciate your help!

See above, explained it there.


Solution

  • `Get-Content -Raw -Encoding UTF8`
    

    Did the trick and it works perfectly fine! Thank you very much iRon!