I have a function that replaces umlauts. If that function is saved as normal script file (.ps1), the output is test-aeoeueAeOeUe1234
. This is what I expect to get :-)
function TestReplace{
Param(
[parameter(Mandatory=$true,Position=0)][ValidateNotNullOrEmpty()][String]$InputString
)
$ResultString = ($InputString.replace('ä', 'ae').replace('ö','oe').replace('ü','ue').replace('Ä', 'Ae').replace('Ö','Oe').replace('Ü','Ue'))
$ResultString
}
TestReplace -InputString "test-äöüÄÖÜ1234"
But if the same function is saved as part of a module (.psm1), the result is test-aeoeueaeoeue1234
- it seems the replace function is case insensitive.
I can't figure out, why the same code leads to different output...