From 23ab34ab724822cf45ea02b5fd2defa98c05a0a7 Mon Sep 17 00:00:00 2001 From: SCOPEDD Date: Thu, 1 Oct 2026 00:29:29 -0400 Subject: [PATCH] Find installed PowerShell on Windows runner --- .gitea/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e5b2669..bcbebff 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -57,6 +57,15 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v5 + - name: Find PowerShell 7 on Windows runner + shell: powershell + run: | + $pwsh = (Get-Command pwsh -ErrorAction SilentlyContinue | Select-Object -First 1).Source + if (-not $pwsh) { $pwsh = Join-Path $env:ProgramFiles 'PowerShell\7\pwsh.exe' } + if (-not (Test-Path $pwsh)) { throw "PowerShell 7 is not available to the runner at $pwsh" } + $version = & $pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' + Write-Host "Using PowerShell $version at $pwsh" + Add-Content -Path $env:GITEA_PATH -Value (Split-Path $pwsh) - name: Verify Windows runner shell: pwsh run: |