cmd /c "reg export HKLMSYSTEMCurrentControlSetControlMUIUILanguages c:lang.reg /y"
$displaylanguage='zh-CN'
#$displaylanguage='en-US'
cmd /c "bcdedit /set {default} locale $displaylanguage"
cmd /c "bcdboot %WinDir% /l $displaylanguage"
function Change-Language1 {
param ($Language)
reg add "HKCUControl PanelDesktop" /f /v "PreferredUILanguages" /t REG_SZ /d $Language
}
function Change-Language2 {
param ($Language)
Set-ItemProperty 'HKCU:Control PanelDesktop' -Name "PreferredUILanguages" -Value $Language
}
Change-Language1 -language $displaylanguage
参考了https://social.technet.microsoft.com/wiki/contents/articles/24450.change-os-language-using-powershell.aspx