From 816a9a3331df62931d9482dc0167620c93159e5a Mon Sep 17 00:00:00 2001 From: Haritha <73516759+HarithaVattikuti@users.noreply.github.com> Date: Mon, 3 Nov 2025 12:07:42 -0600 Subject: [PATCH] Refactor Pester installation step in workflow --- .github/workflows/build-tool-packages.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-tool-packages.yml b/.github/workflows/build-tool-packages.yml index c41f35f..76b4fdb 100644 --- a/.github/workflows/build-tool-packages.yml +++ b/.github/workflows/build-tool-packages.yml @@ -160,9 +160,13 @@ jobs: Write-Host "to determine if ${{ inputs.tool-name }} version was consumed from cache or if it was downloaded" for ($i = 0; $i -lt 200; $i++) { Get-Random } - - name: Install Pester - run: Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck - + - name: Ensure Pester Installed + run: | + $module = Get-Module -ListAvailable -Name Pester + if (-not $module -or ($module.Version -lt [Version]"5.0.0")) { + Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck + } + - name: Run tests if: env.excludewinarm == 'true' env: