利用PowerShell下載離線Windows Terminal應用程式
簡單來說,這是參考黑大的「在網路隔離環境安裝 Windows Terminal」的PowerShell Core實作版。讓各位不論是用複製貼上還是執行指令碼的方式,用最快速的方式取得一份離線Windows Terminal應用程式。
備註:由於PowerShell不支援解壓縮.msix,所以僅支援PowerShell Core。
補充:如果你想在Windows Server上使用Windows Terminal,目前僅Windows Server 2022支援。Windows Server 2022離線安裝的方式更簡單,將下載回來的.msixbundle透過以下指令安裝即可:
Add-AppxPackage Microsoft.WindowsTerminal_{versionNumber}.msixbundle
Windows Server 2022安裝Windows Terminal,請參考:https://blog.kkbruce.net/2022/05/windows-server-2022-windows-terminal.html
回覆刪除實在是太感謝了!
回覆刪除-受到幫助的小萌新
Invoke-WebRequest https://github.com/microsoft/terminal/releases/download/v1.23.12371.0/Microsoft.WindowsTerminal_1.23.12371.0_8wekyb3d8bbwe.msixbundle_Windows10_PreinstallKit.zip -OutFile Windows10_PreinstallKit.zip
回覆刪除Expand-Archive .\Windows10_PreinstallKit.zip .\WTSource\.
add-appxpackage .\WTSource\Microsoft.UI.Xaml.2.8_8.2501.31001.0_x64__8wekyb3d8bbwe.appx
add-appxpackage .\WTSource\7d37c32af9f64227a7f03dfb1d1ab7b2.msixbundle
Remove-Item .\Windows10_PreinstallKit.zip
Remove-Item .\WTSource\ -Recurse
Windows Server 2022 may lack of installation of Mircrosoft UI XML 2.8. This will ease the problem.
Bonus:
#Powershell core 7.5.2 installation
Invoke-WebRequest https://github.com/PowerShell/PowerShell/releases/download/v7.5.2/PowerShell-7.5.2-win-x64.msi -OutFile PowerShell-7.5.2-win-x64.msi
msiexec.exe /package PowerShell-7.5.2-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1 USE_MU=1 ENABLE_MU=1 ADD_PATH=1 DISABLE_TELEMETRY=1