-
Notifications
You must be signed in to change notification settings - Fork 1
/
win-lang.ps1
18 lines (15 loc) · 1.06 KB
/
win-lang.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/mnt/c/Windows/System32/WindowsPowerShell/v1.0//powershell.exe -File
# This is a personal file.
# It fixes a bug in Windows when there can sometimes be duplicated keyboard layout entries
# which make language switching unreliable.
# These layouts are not listed by Windows, so we first add them, and then remove them.
$LanguageList = Get-WinUserLanguageList
($LanguageList | Where-Object LanguageTag -like 'en-US').InputMethodTips.Add('0409:A0000409')
($LanguageList | Where-Object LanguageTag -like 'en-US').InputMethodTips.Add('0409:00000409')
($LanguageList | Where-Object LanguageTag -like 'ru').InputMethodTips.Add('0419:A0000419')
($LanguageList | Where-Object LanguageTag -like 'ru').InputMethodTips.Add('0419:00000419')
Set-WinUserLanguageList -Force -LanguageList $LanguageList
$LanguageList = Get-WinUserLanguageList
($LanguageList | Where-Object LanguageTag -like 'en-US').InputMethodTips.Remove('0409:00000409')
($LanguageList | Where-Object LanguageTag -like 'ru').InputMethodTips.Remove('0419:00000419')
Set-WinUserLanguageList -Force -LanguageList $LanguageList