标签: windows-server-2022

为 Windows 容器设置时区

我正在尝试设置基于 windows nano server 2019 Build 1809 的 WindowsContainer 的时区。

为 linux 容器执行此操作的最简单方法之一是设置 TimeZone 环境变量,如下所示:

docker run -e TZ=Asia/Kolkata ubuntu date
Run Code Online (Sandbox Code Playgroud)

对于 Windows 容器,我们是否有类似的东西。基于一般的 Windows 方法,我尝试使用 PowerShell 之类的(如下所示)在入口点脚本中设置它,但它也给了我一个错误。

Set-TimeZone -Name "India Standard Time"
Set-TimeZone : Access is denied
At line:1 char:1
+ Set-TimeZone -Name "India Standard Time"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : FromStdErr: (:) [Set-TimeZone], Win32Exception
+ FullyQualifiedErrorId : SetTimeZoneFailed,Microsoft.PowerShell.Commands.SetTimeZoneCommand
Run Code Online (Sandbox Code Playgroud)

关于如何为基于 Windows Nanoserver 2019 Build 1809 的 Windows 容器完成此操作有任何想法吗?

powershell docker windows-container windows-server-2019 windows-server-2022

7
推荐指数
3
解决办法
5951
查看次数

如何在 Windows Server Core 2022 上安装 Visual Studio 2022 构建工具

我尝试在完全更新的 Windows Server 2022 Core 安装上将 Visual Studio 2022 构建工具安装为 ESXi 上的虚拟机。每当我开始安装时,我都会看到 GUI 在提取文件时出现,然后崩溃并留下事件日志条目:

Application: vs_setup_bootstrapper.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NotImplementedException
   at MS.Win32.UnsafeNativeMethods+ITfThreadMgr.CreateDocumentMgr(ITfDocumentMgr ByRef)
   at System.Windows.Input.TextServicesContext.RegisterTextStore(System.Windows.Input.DefaultTextStore)
   at System.Windows.Input.DefaultTextStore.get_Current()
   at System.Windows.Input.TextServicesContext.SetFocusOnDefaultTextStore()
   at System.Windows.Input.InputMethod.EnableOrDisableInputMethod(Boolean)
   at System.Windows.Input.TextServicesManager.Focus(System.Windows.DependencyObject)
   at System.Windows.Input.KeyboardDevice.ChangeFocus(System.Windows.DependencyObject, Int32)
   at System.Windows.Input.KeyboardDevice.TryChangeFocus(System.Windows.DependencyObject, System.Windows.Input.IKeyboardInputProvider, Boolean, Boolean, Boolean)
   at System.Windows.Input.KeyboardDevice.Focus(System.Windows.DependencyObject, Boolean, Boolean, Boolean)
   at System.Windows.Input.KeyboardDevice.Focus(System.Windows.IInputElement)
Run Code Online (Sandbox Code Playgroud)

我还尝试手动提取文件并运行,但使用本指南会发生同样的事情,因为安装程序本身正在崩溃:

https://silentinstallhq.com/visual-studio-build-tools-2022-silent-install-how-to-guide/

谁能告诉我为什么失败?

build-tools windows-server-2022 visual-studio-2022

6
推荐指数
2
解决办法
3万
查看次数