Remove language from Windows 10 using PowerShell

前端 未结 1 1065
小鲜肉
小鲜肉 2021-02-19 17:56

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

1条回答
  •  执笔经年
    2021-02-19 18:33

    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

    0 讨论(0)
提交回复
热议问题