From 2de86dd932775a662bb45e39b34c4ffd610223f4 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Mar 2026 19:02:05 +0000 Subject: [PATCH] Fix install.ps1 failing on Windows PowerShell 5.1 via irm | iex Wrap bare `if` expression assignments in $() subexpressions for compatibility with Windows PowerShell 5.1, which doesn't support `if` as an expression on the RHS of assignments without $(). https://claude.ai/code/session_01HfYjYPU2SBFdzSxMKF5ruf --- install.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.ps1 b/install.ps1 index a5604b8..b1df145 100644 --- a/install.ps1 +++ b/install.ps1 @@ -14,9 +14,9 @@ $ErrorActionPreference = "Stop" # ───── Config ───── -$MizanMethod = if ($env:MIZAN_METHOD) { $env:MIZAN_METHOD } else { "pip" } -$MizanDir = if ($env:MIZAN_DIR) { $env:MIZAN_DIR } else { Join-Path $HOME "mizan" } -$MizanBranch = if ($env:MIZAN_BRANCH) { $env:MIZAN_BRANCH } else { "main" } +$MizanMethod = $(if ($env:MIZAN_METHOD) { $env:MIZAN_METHOD } else { "pip" }) +$MizanDir = $(if ($env:MIZAN_DIR) { $env:MIZAN_DIR } else { Join-Path $HOME "mizan" }) +$MizanBranch = $(if ($env:MIZAN_BRANCH) { $env:MIZAN_BRANCH } else { "main" }) $MizanRepo = "https://github.com/CodeWithJuber/mizan.git" $MizanMinPython = "3.11" $MizanMinNode = 18 @@ -64,7 +64,7 @@ function Compare-Version { # ───── OS Detection ───── function Get-Platform { - $arch = if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" } + $arch = $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" }) Write-Info "Detected: Windows ($arch)" return @{ OS = "windows"; Arch = $arch } }