Created
October 14, 2025 12:50
-
-
Save ebicoglu/629d029be0218417e1a64b7006887e2f to your computer and use it in GitHub Desktop.
Removes all the keyboard layouts except TURKISH-Q with Powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # KEYBOARD LAYOUT CODES | |
| # https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-input-locales-for-windows-language-packs?view=windows-11 | |
| $LangCodeToKeep = '0409:0000041F' #TURKISH-Q | |
| # Get all current language lists | |
| $langs = Get-WinUserLanguageList | |
| # Remove everything except en-US | |
| $keep = $langs | Where-Object { $_.LanguageTag -eq 'en-US' } | |
| # If en-US doesn't exist, create it | |
| if (-not $keep) | |
| { | |
| $keep = New-WinUserLanguageList 'en-US' | |
| } | |
| # Create a fresh en-US language object | |
| $newLang = New-WinUserLanguageList 'en-US' | |
| # Replace its InputMethodTips with only selected language code | |
| $newLang[0].InputMethodTips.Clear() | |
| $newLang[0].InputMethodTips.Add($LangCodeToKeep) | |
| # Apply only this language and keyboard | |
| Set-WinUserLanguageList $newLang -Force | |
| Write-Host "Only language with keyboard layout code $LangCodeToKeep has been kept." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment