I want to use Powershell to add or remove a language and change the keyboard layout from left to right or from right to left in Windows 10. I wrote code to add a language but I cannot find a guide to remove it again or to change the layout. I also want to ask the user if he wants to add or to remove a language.
This is my code:
$List = Get-WinUserLanguageList
$List.Add("lt-LT")
Set-WinUserLanguageList $List
Thank you in advance.
Remove extra language packs or keyboard languagesSelect Start > Settings > Time & language > Language & region. Under Preferred languages, select the language you want to remove, and then select Remove.
Click File > Options > Language. Under Choose Editing Languages, select the language that you want to remove, and then click Remove.
On the Time & language page, select Language on the left sidebar. On the right pane, scroll down to the Preferred languages section. In it, locate the Windows 10 language pack that you want to uninstall and select it by clicking or tapping on it. Then, press the Remove button on the right of that language.
Go to Settings, Time and language, Region and language, first make sure that the language you want to leave this as Default, then you click on the LANGUAGE you want to delete and click on Remove. The problem should be solved.
I managed to do this by using the index of the English language in the $List
array in combination with the Set-WinUserLanguageList
cmdlet. I found it odd that I couldn't simply reverse the steps by using the $list.remove("lt-LT")
method, as it returns False
, so I set about recreating the list another way.
After you've added "lt-LT" to the list, I ran the first cmdlet again to see what we were working with:
$list = Get-WinUserLanguageList
Which returned an array with two objects. $list[0]
Returned
LanguageTag : en-US
Autonym : English (United States)
EnglishName : English
LocalizedName : English (United States)
ScriptName : Latin script
InputMethodTips : {0409:00000409}
Spellchecking : True
Handwriting : False
and $list[1]
returned
LanguageTag : lt
Autonym : lietuvių
EnglishName : Lithuanian
LocalizedName : Lithuanian
ScriptName : Latin script
InputMethodTips : {0427:00010427}
Spellchecking : True
Handwriting : False
So what we needed to do was ensure that Set-WinUserLanguageList
only got one of the inputs. I ran the following and it set the Language list appropriately.
Set-WinUserLanguageList $($list[0])
And now only the appropriate list is returned when running Get-WinUserLanguageList
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With