在没有 Microsoft Store 的情况下安装 Windows 终端
如果 Microsoft Store 应用丢失或损坏(例如,在 Windows 10 LTSC 或 Windows Server 2022 中),您可以通过以下方式之一安装 Windows 终端:
- 通过从 GitHub 手动下载最新的 Windows Terminal 版本并在 Windows 中安装 MSIX 文件;
- 通过使用 Chocolatey 或 WinGet 包管理器。
对于手动安装 Windows Terminal,您需要下载别把我们捆绑在一起包来自项目官方GitHubhttps://github.com/microsoft/terminal/releases。在以下位置查找适合您的 Windows 版本的最新终端版本资产部分并下载文件。
您还可以从 Microsoft Store 手动下载最新版本的 APPX/MSIXbundle 应用程序。
您可以使用 Invoke-WebRequest cmdlet 下载安装文件:
Invoke-WebRequest -Uri https://github.com/microsoft/terminal/releases/download/v1.18.3181.0/Microsoft.WindowsTerminal_1.18.3181.0_8wekyb3d8bbwe.msixbundle
接下来,使用 Add-AppxPackage cmdlet 在 Windows 中安装包:
Add-AppxPackage -Path .Microsoft.WindowsTerminal_1.18.3181.0_8wekyb3d8bbwe.msixbundle
检查软件包是否已成功安装::
Get-AppxPackage *WindowsTerminal* -AllUsers

如果您使用的是最新的 PowerShell Core 7.x,请首先导入 AppX / MSIX 包安装模块:
Import-Module Appx -UseWindowsPowerShell
在较旧的 Windows 10 版本上手动安装 Windows 终端时,可能会出现以下错误:
Add-AppPackage : Deployment failed with HRESULT: 0x80073CF3, Package failed updates, dependency or conflict validation. Windows cannot install package Microsoft.WindowsTerminal_1.18.3181.0_8wekyb3d8bbwe.msixbundle because this package depends on a framework that could not be found. Provide the framework "Microsoft.VCLibs.140.00.UWPDesktop" published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x64 processor architecture and minimum version 14.0.30035.0, along with this package to install. The frameworks with name Microsoft.VCLibs.140.00.UWPDesktop" currently installed are ..... You must download and install the VCLibs framework before installing the Microsoft.WindowsTerminal package.
下载VC库包裹 (https://learn.microsoft.com/en-us/troubleshoot/developer/visualstudio/cpp/libraries/c-runtime-packages-desktop-bridge)并使用以下命令安装它:
Add-AppPackage .Microsoft.VCLibs.x64.14.00.Desktop.appx
在 Windows Server 2019 或 2016 上安装 Microsoft.WindowsTerminal 包时,您可能会收到另一个错误:
Add-AppxPackage : Deployment failed with HRESULT: 0x80073CFD, A Prerequisite for an install could not be satisfied. Windows cannot install package Microsoft.WindowsTerminal_1.18.3181.0_8wekyb3d8bbwe because this package is not compatible with the device. The package requires OS version 10.0.19041.0 or higher on the Windows.Mobile device family. The device is currently running OS version 10.0.17763.107.


您可以在此处看到该软件包在安装过程中检查操作系统。要安装 Windows 终端,您需要 Windows 1903 (10.0.18362.0) 或更高版本。因此,您无法在 Windows Server 2019 上安装 Windows Terminal。在这种情况下,您可以使用独立的经典 Windows 终端应用程序,自版本 v1.17.11391.0 起可在 GitHub 上获取。下载 Microsoft.WindowsTerminal_1.18.3181.0_x64.zip 存档并将其解压到本地驱动器上的目录中。


如果您得到的是0x80073CFDWindows 10 中出现错误,请尝试安装更新或使用早期版本的 Microsoft.WindowsTerminal。
您还可以下载最新版本的 Microsoft.WindowsTerminal 软件包并使用 WinGet 软件包管理器进行安装:
winget install --id=Microsoft.WindowsTerminal -e


或者加巧克力:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install microsoft-windows-terminal
可以安装旧版本的软件包:
choco install -y microsoft-windows-terminal --version 1.12.10732.0
在 Windows Server 2019 上通过 choco 安装软件包时,您会看到以下错误:
阅读更多:如何修复 Windows 11 上的 Microsoft Store 错误 0x00000191
ERROR: This package requires at least Windows 10 version 1903/OS build 18362.x. The install of microsoft-windows-terminal was NOT successful. Error while running 'C:ProgramDatachocolateylibmicrosoft-windows-terminaltoolschocolateyInstall.ps1'.


最后,要运行 Windows 终端,请运行命令:
wt.exe


