diff --git a/packages/powershell/oh-my-posh/deploy.ps1 b/packages/powershell/oh-my-posh/deploy.ps1 index cf1754bf4594..f4d5b6885537 100644 --- a/packages/powershell/oh-my-posh/deploy.ps1 +++ b/packages/powershell/oh-my-posh/deploy.ps1 @@ -20,7 +20,7 @@ Param Copy-Item -Path "../../../themes" -Destination "./themes" -Recurse # fetch all the binaries from the version's GitHub release New-Item -Path "./" -Name "bin" -ItemType "directory" -"posh-windows-amd64.exe", "posh-windows-386.exe", "posh-darwin-amd64", "posh-linux-amd64", "posh-linux-arm" | ForEach-Object -Process { +"posh-windows-amd64.exe", "posh-windows-386.exe", "posh-windows-arm64.exe", "posh-darwin-amd64", "posh-linux-amd64", "posh-linux-arm" | ForEach-Object -Process { $download = "https://github.com/jandedobbeleer/oh-my-posh/releases/download/v$BinVersion/$_" Invoke-WebRequest $download -Out "./bin/$_" } diff --git a/packages/powershell/oh-my-posh/oh-my-posh.psm1 b/packages/powershell/oh-my-posh/oh-my-posh.psm1 index 3ec16868cf09..6f96d60ee479 100644 --- a/packages/powershell/oh-my-posh/oh-my-posh.psm1 +++ b/packages/powershell/oh-my-posh/oh-my-posh.psm1 @@ -19,10 +19,13 @@ function Get-PoshCommand { } return "$PSScriptRoot/bin/posh-linux-amd64" } - if ([Environment]::Is64BitOperatingSystem) { - return "$PSScriptRoot/bin/posh-windows-amd64.exe" + $arch = (Get-CimInstance -Class Win32_Processor -Property Architecture).Architecture + switch ($arch) { + 0 { return "$PSScriptRoot/bin/posh-windows-386.exe" } # x86 + 5 { return "$PSScriptRoot/bin/posh-windows-arm64.exe" } # ARM + 9 { return "$PSScriptRoot/bin/posh-windows-amd64.exe" } # x64 } - return "$PSScriptRoot/bin/posh-windows-386.exe" + throw "Oh My Posh: Unsupported architecture: $arch" } function Set-ExecutablePermissions {