I am trying to write a script, which I want to call to replace a German umlaut, ü,ä,ö etc.
I tried several versions using .replace and using -replace in one line and in multiple lines, it does not matter
Now I am stuck with this:
[CmdletBinding()]
param (
[Parameter()]
[string]
$name
)
$name = $name -replace 'ö','oe'
$name = $name -replace 'ä','ae'
$name = $name -replace 'ü','ue'
$name = $name -replace 'ß','ss'
$name = $name -replace 'Ö','Oe'
$name = $name -replace 'Ü','Ue'
$name = $name -replace 'Ä','Ae'
return $name
When I call the script/function it just does not replace any character. I tried "WürstWäßerWörfer" and it does nothing. If I set $name to "WürstWäßerWörfer" and only execute the $name =$name -replace
commands it does work. If I call the script/function it doesn't work.
I call the script by .\entgermanisierung "WürstWäßerWörfer" and it returns "WürstWäßerWörfer"