From b65d4787b1fe05e19c07b8b4e0c9c8f23a2a6ea5 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Wed, 5 Jun 2024 10:21:07 +0100 Subject: [PATCH] Add function to set my locale prefs --- .../files/Microsoft.PowerShell_profile.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 b/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 index e0e65ea..0ecc024 100644 --- a/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 +++ b/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 @@ -63,6 +63,20 @@ function mkcd { Set-Location -Path $Path } +function Set-AcpLocale { + # Set the default en-GB locale. + Set-WinUserLanguageList -LanguageList en-GB -Force + # Get the default locale back. + $AcpLocale = Get-WinUserLanguageList + # Remove the British layout and add the US layout. + $AcpLocale[0].InputMethodTips.Remove("0809:00000809") + $AcpLocale[0].InputMethodTips.Add("0809:00000409") + # Set the locale to our customised version. + Set-WinUserLanguageList -LanguageList $AcpLocale -Force + # Clean up. + Remove-Variable AcpLocale +} + if ($IsWindows -or ($env:OS -eq "Windows_NT")) { function who { & "$env:SystemRoot\System32\query.exe" user