-
-
Save ysichrisdag/b055ebd0cbec240f2805069fedc3ad3f to your computer and use it in GitHub Desktop.
Install Windows Terminal on Windows Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Information "This script needs be run on Windows Server 2019 or 2022" | |
If ($PSVersionTable.PSVersion.Major -ge 7){ Write-Error "This script needs be run by version of PowerShell prior to 7.0" } | |
# Define environment variables | |
$downloadDir = "C:\WinTerminal" | |
$gitRepo = "microsoft/terminal" | |
$filenamePattern = "*.msixbundle" | |
$framworkPkgUrl = "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx" | |
$framworkPkgPath = "$downloadDir\Microsoft.VCLibs.x64.14.00.Desktop.appx" | |
$xamlPkgUrl = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.5/Microsoft.UI.Xaml.2.8.x64.appx" | |
$xamlPkgPath = "$downloadDir\Microsoft.UI.Xaml.2.8.x64.appx" | |
$msiPath = "$downloadDir\Microsoft.WindowsTerminal.msixbundle" | |
$releasesUri = "https://api.github.com/repos/$gitRepo/releases/latest" | |
$downloadUri = ((Invoke-RestMethod -Method GET -Uri $releasesUri).assets | Where-Object name -like $filenamePattern ).browser_download_url # | Select-Object -SkipLast 1 | |
# Download C++ Runtime framework packages for Desktop Bridge and Windows Terminal latest release msixbundle | |
Invoke-WebRequest -Uri $framworkPkgUrl -OutFile ( New-Item -Path $framworkPkgPath -Force ) | |
Invoke-WebRequest -Uri $xamlPkgUrl -OutFile ( New-Item -Path $xamlPkgPath -Force ) | |
Invoke-WebRequest -Uri $downloadUri -OutFile ( New-Item -Path $msiPath -Force ) | |
# Install C++ Runtime framework packages for Desktop Bridge and Windows Terminal latest release | |
Add-AppxPackage -Path $framworkPkgPath | |
Add-AppxPackage -Path $xamlPkgPath | |
Add-AppxPackage -Path $msiPath | |
# Cleanup | |
Remove-Item $downloadDir -Recurse -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With Windows Server 2019 >=10.0.19041.0 not working on 10.0.17763.5329
https://learn.microsoft.com/en-us/windows-server/get-started/windows-server-release-info