Google计算引擎Windows语言环境

我正在尝试使用自动PowerShell启动脚本为Google Compute Engine Windows实例上的所有用户设置默认语言环境/区域。

我已经尝试了以下脚本:

Import-Module International #set home location to Australia Set-WinHomeLocation -GeoId 12 # Set locale to English (Australia) (needs a restart) Set-WinSystemLocale en-AU # Set regional format (date/time etc.) to English (Australia) - this applies to all users Set-Culture en-AU # Set the language list for the user, forcing English (Australia) to be the only language Set-WinUserLanguageList en-AU -Force 

还有这个脚本,使用一个区域xml文件将上面的相同设置复制到默认帐户和系统帐户:

 & "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gsutil" cp gs://mybucket/auregion.xml C:\ & $env:SystemRoot\System32\control.exe "intl.cpl,,/f:`"c:\auregion.xml`"" 

auregion.xml的内容:

 <gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend"> <!--User List--> <gs:UserList> <gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/> </gs:UserList> <gs:UserLocale> <gs:Locale Name="en-AU" SetAsCurrent="true"/> </gs:UserLocale> <gs:SystemLocale Name="en-AU"/> <!--location--> <gs:LocationPreferences> <gs:GeoID Value="12"/> </gs:LocationPreferences> </gs:GlobalizationServices> 

但是在GCE中设置为windows-startup-script-ps1或者sysprep-specialize-script-ps1时都不起作用。 我知道脚本正在运行,因为它也通过正在工作的tzutil设置时区,并且它为第二个脚本创buildauregion.xml文件。

当用户远程运行到虚拟机中时,相同的脚本可以工作。

也许有一个更简单的方法? 除了创build自定义图像之外,我无法在GCE中看到任何configuration选项来自动设置区域设置。

为用户查看此主题发布答案。

Set-WinSystemLocale将使用' windows-startup-script-ps1 '键在GCE上使用启动脚本 。 这需要重新启动,因为在sysprep专门化期间它不能被设置。

对于Set-WinHomeLocation,Set-Culture和Set-WinUserLanguageList,无法使用GCE上的启动脚本来设置值,因为它需要当前用户的所有更改设置。