Skip to content

Instantly share code, notes, and snippets.

@jamesWalker55
Created July 24, 2022 16:01
Show Gist options
  • Save jamesWalker55/19f4cc80ce08aba3eff8966c4df6a6ba to your computer and use it in GitHub Desktop.
Save jamesWalker55/19f4cc80ce08aba3eff8966c4df6a6ba to your computer and use it in GitHub Desktop.
This is a powershell script that automatically adds then removes "en-US" from the keyboard input methods list.
# This script solves the issue in this stackoverflow question:
# https://superuser.com/questions/1092246/how-to-prevent-windows-10-from-automatically-adding-keyboard-layouts-i-e-us-ke
# This method adds the en-US layout then removes it, ensuring that the layout is always removed from the taskbar
# I don't have a high enough reputation so I can't post this there, so here is the script:
# define the language to be removed
$LanguageToRemove = "en-US"
# get the current language list
$LangList = Get-WinUserLanguageList
# add "en-US" to the list and save
$LangList.Add($LanguageToRemove)
Set-WinUserLanguageList $LangList
# remove "en-US" from the list and save
$USLangObj = $LangList | Where-Object LanguageTag -like $LanguageToRemove
$LangList.Remove($USLangObj)
Set-WinUserLanguageList $LangList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment