I have written a script for my MySQL database with the Powershell ISE, which creates a backup for me with the help of the MySQL dump tool. When I run the script in the PowerShell ISE, everything works. If I execute the same script now in the normal PowerShell, he does not show me the German umlauts correctly.
Here is my script:
# delete everything older than 30 days
foreach ($ordner in (ls D:\Backup -Depth 0))
{
if ($ordner.LastWriteTime.Date -lt (Get-Date).AddDays(-30).Date)
{
rm -Recurse ("D:\Backup\"+ $ordner.Name)
}
}
mkdir ("D:\Backup\" + (Get-Date -Format "yyyy_MM_dd") + "\Datenbank")
C:\xampp\mysql\bin\mysqldump.exe -uroot --default-character-set=latin1 --opt MY_DATABASE > ("D:\Backup\"+(Get-Date -Format "yyyy_MM_dd") + "\Datenbank\backup.sql")
However, I need the normal PowerShell for the automated execution and the script.
How can I fix the problem that the German umlauts are displayed in the normal PowerShell correctly?