Thursday, February 4, 2016

Adding/removing keyboard layouts with PowerShell

Sometimes I need to type in German or in Russian. Often enough – every week I type something. Meanwhile, it bugs me to find the right layout every time.

And since I now prefer PowerShell to cmd.exe, I had a thought – I should add these layouts as I need them. So, now I have two files:

addDe.ps1:
$1 = Get-WinUserLanguageList
$1.Add('de-DE')
Set-WinUserLanguageList $1 -Force

remDe.ps1:
$1 = Get-WinUserLanguageList
$1.RemoveAll( { $args[0].LanguageTag -clike 'de*' } )
Set-WinUserLanguageList $1 -Force

They're simple and awesome.

No comments:

Post a Comment