From 540ba2458a97c0c222c4e0e7614d605731439c89 Mon Sep 17 00:00:00 2001 From: liuhao Date: Sun, 10 May 2026 18:16:42 +0800 Subject: [PATCH] fix(install): convert OSArchitecture enum to string before switch comparison PowerShell 5.1 returns Architecture enum instead of string for System.Runtime.InteropServices.RuntimeInformation.OSArchitecture, causing switch comparison to fail with 'Unsupported architecture' error. --- scripts/install.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index cc0fe69..00482c6 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -52,10 +52,11 @@ function Get-OS { function Get-Arch { try { $arch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture - switch ($arch) { + $archStr = $arch.ToString() + switch ($archStr) { "X64" { return "amd64" } "Arm64" { return "arm64" } - default { Write-Error-Exit "Unsupported architecture: $arch" } + default { Write-Error-Exit "Unsupported architecture: $archStr" } } } catch { }