From fba295601c3ad34b68a5e607b1a63ea419f238e3 Mon Sep 17 00:00:00 2001 From: Qais Patankar Date: Wed, 21 Jan 2026 23:45:21 -0500 Subject: [PATCH] clang-format.ps1: check powershell version Add PowerShell version check for script compatibility --- utils/clang-format.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/utils/clang-format.ps1 b/utils/clang-format.ps1 index ea4c76a845..79ce02559c 100755 --- a/utils/clang-format.ps1 +++ b/utils/clang-format.ps1 @@ -1,5 +1,19 @@ #!/usr/bin/env pwsh +# Check PowerShell version +if ($PSVersionTable.PSVersion.Major -lt 7) { + $currentVersion = $PSVersionTable.PSVersion + Write-Error @" +This script requires PowerShell 7 or later. +Current version: $currentVersion + +Install PowerShell 7+: + - Or run: winget install Microsoft.PowerShell (Windows) + - Windows/macOS/Linux: https://github.com/PowerShell/PowerShell#get-powershell +"@ + exit 1 +} + $ToolConfig = @{ "clang-format" = @{ "linux-amd64" = @{