From e8bf6ca18a04ee04b290d2f01f5ef01750280d36 Mon Sep 17 00:00:00 2001 From: 77 Date: Wed, 15 Jul 2020 18:06:58 -0700 Subject: [PATCH] Add support for installing ARM64 MSIX package. (#13043) --- tools/install-powershell.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index 4a8c47daf0..6347982227 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -248,6 +248,8 @@ Function Add-PathTToSettings { if (-not $IsWinEnv) { $architecture = "x64" +} elseif ($(Get-ComputerInfo -Property OsArchitecture).OsArchitecture -eq "ARM 64-bit Processor") { + $architecture = "arm64" } else { switch ($env:PROCESSOR_ARCHITECTURE) { "AMD64" { $architecture = "x64" } @@ -350,7 +352,11 @@ try { if ($IsWinEnv) { if ($UseMSI) { - $packageName = "PowerShell-${release}-win-${architecture}.msi" + if ($architecture -eq "arm64") { + $packageName = "PowerShell-${release}-win-${architecture}.msix" + } else { + $packageName = "PowerShell-${release}-win-${architecture}.msi" + } } else { $packageName = "PowerShell-${release}-win-${architecture}.zip" } @@ -382,7 +388,9 @@ try { $null = New-Item -ItemType Directory -Path $contentPath -ErrorAction SilentlyContinue if ($IsWinEnv) { - if ($UseMSI -and $Quiet) { + if ($UseMSI -and $architecture -eq "arm64") { + Add-AppxPackage -Path $packagePath + } elseif ($UseMSI -and $Quiet) { Write-Verbose "Performing quiet install" $ArgumentList=@("/i", $packagePath, "/quiet") if($MSIArguments) {