Windows Server2022安装Terminal、AIShell

安装Terminal

1、下载安装包

     访问 https://github.com/microsoft/terminal/releases/tag/v1.22.12111.0 下载以下2个文件

image

 

2、加压文件Microsoft.WindowsTerminal_1.22.12111.0_8wekyb3d8bbwe.msixbundle_Windows10_PreinstallKit

     使用系统自带的Powershell(v5.0)进行安装

Import-Module appx
cd D:\Microsoft.WindowsTerminal_1.22.12111.0_8wekyb3d8bbwe.msixbundle_Windows10_PreinstallKit
#先安装所依赖的框架
 Add-AppxPackage .\Microsoft.UI.Xaml.2.8_8.2501.31001.0_x64__8wekyb3d8bbwe.appx
cd ..  #回到上一级目录,进行安装
 Add-AppxPackage .\Microsoft.WindowsTerminal_1.22.12111.0_8wekyb3d8bbwe.msixbundle

#安装完成后,搜索“终端”即可使用

 

注:使用PowerShell 7.0版本运行“Import-Module appx”命令,会出现以下报错

Import-Module: Operation is not supported on this platform. (0x80131539)

 

安装AIShell:

image

 参考:https://learn.microsoft.com/zh-cn/powershell/utility-modules/aishell/install-aishell?view=ps-modules&tabs=windows

1、从 GitHub 发布页(https://github.com/PowerShell/AIShell/releases)下载最新版本。 选择与系统体系结构匹配的文件。 例如,AIShell-1.0.0-preview.2-win-x64.zip。

2、将 ZIP 文件的内容提取到系统上的位置(C:\Users\Administrator\AppData\Local\Programs\AIShell)。

3、将提取的文件夹添加到 PATH 环境变量(当前用户)。

4、从 PowerShell 库安装 AI Shell 模块。
      Install-PSResource -Name AIShell -Prerelease       #ps7.0已将参数-Preview替换为-Prerelease

 

PSReadLine版本升级:

Windows Server 2022自带的PSReadLine版本为2.3.6,将其升级到2.4.3-beat3版本:

1、使用如下命令查看可用的版本:

Find-Module -Name PSReadLine -AllVersions -AllowPrerelease

image

 2、安装指定的版本:

Install-Module -Name PSReadLine -RequiredVersion 2.4.3-beta3 -AllowPrerelease -Force -SkipPublisherCheck

-AllowPrerelease:允许安装预发布版本。
-Force:强制覆盖已安装的同名模块(即使版本较低)。
-SkipPublisherCheck:由于是预发布模块,签名可能不完整,跳过发布者检查(可选,视安全策略而定)。

3、打开新的ps窗口查看版本

image

 

posted on 2025-10-10 16:50  momingliu11  阅读(17)  评论(0)    收藏  举报