Support Windows PowerShell 5 architecture detection

This commit is contained in:
2026-07-12 02:05:47 +00:00
parent 2881f02d18
commit 53823bad81
+10 -4
View File
@@ -11,10 +11,15 @@ param(
$ErrorActionPreference = "Stop"
$GiteaUrl = $GiteaUrl.TrimEnd("/")
switch ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString()) {
"X64" { $arch = "amd64" }
"Arm64" { $arch = "arm64" }
default { throw "Unsupported Windows architecture: $($_)" }
$architecture = if ($env:PROCESSOR_ARCHITEW6432) {
[string]$env:PROCESSOR_ARCHITEW6432
} else {
[string]$env:PROCESSOR_ARCHITECTURE
}
switch ($architecture.ToUpperInvariant()) {
"AMD64" { $arch = "amd64" }
"ARM64" { $arch = "arm64" }
default { throw "Unsupported Windows architecture: $architecture" }
}
$asset = "hop_windows_${arch}.zip"
@@ -92,3 +97,4 @@ try {
}