From 6870aafe1dd53a66f9904e7860c839280c3b0e78 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Wed, 8 Jul 2026 15:43:09 +0200 Subject: [PATCH 01/10] Make the Pester version configurable (default latest) Add Pester_Version and Pester_Prerelease inputs so consumers can constrain the installed Pester (NuGet range syntax, e.g. [6.0.0,7.0.0)) while the action keeps defaulting to the latest version. This removes the need to bake a version lock into the shared action. Install-PSResourceWithRetry now installs the version satisfying the constraint and imports that exact version into the global session state, so the Pester that runs is deterministic even when the runner ships a different preinstalled Pester (previously PowerShell auto-loaded the highest version on PSModulePath). The 'test kit versions' output now reports the imported version via Get-Module. Relates to #68. Supersedes #70. --- README.md | 4 +++ action.yml | 14 ++++++++++ src/Helpers.psm1 | 66 ++++++++++++++++++++++++++++++++++++++++++++---- src/exec.ps1 | 13 +++++++--- src/init.ps1 | 8 ++++-- 5 files changed, 94 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index aa681cb9..dac47705 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,8 @@ If you specify `CodeCoverage_Enabled: true` here, it will enable coverage even i 1. **Prerequisite Setup** - Installs required PowerShell modules if they're not present. + - Installs Pester at the latest version by default, or the version matching the `Pester_Version` constraint when set. + - Imports the exact installed Pester version so the version that runs is deterministic, even when the runner ships a different preinstalled Pester. - Imports the modules so the testing framework is ready to use. 2. **Loading Inputs and Configuration** - Loads a default Pester configuration. @@ -262,6 +264,8 @@ jobs: | **Input** | **Description** | **Default** | |--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------| | `Path` | Path to where tests are located or a configuration file. | *(none)* | +| `Pester_Version` | Version of Pester to install (NuGet range, e.g. `[6.0.0,7.0.0)` for any 6.x). Empty installs the latest version. | *(none)* | +| `Pester_Prerelease` | Allow installing prerelease versions of Pester. | `false` | | `ReportAsJson` | Output generated reports in JSON format in addition to the configured format through Pester. | `true` | | `Prescript` | Script to be executed before the test run. This script is executed in the same context as the test run. | *(none)* | | `Notice_Mode` | Controls when to show notices for test completion.
| `Failed` | diff --git a/action.yml b/action.yml index 95c1da12..8c2d70ca 100644 --- a/action.yml +++ b/action.yml @@ -10,6 +10,16 @@ inputs: description: | Path to where tests are located or a configuration file. required: false + Pester_Version: + description: | + Version of the Pester module to install, using NuGet version-range syntax, e.g. '[6.0.0,7.0.0)' to allow any 6.x. + A single value such as '6.4.0' installs that exact version. When empty, the latest available version is installed. + required: false + Pester_Prerelease: + description: | + Allow installing prerelease versions of Pester. + required: false + default: 'false' ReportAsJson: description: | Output generated reports in JSON format in addition to the configured format through Pester. @@ -288,6 +298,8 @@ runs: uses: PSModule/GitHub-Script@1ee97bbc652d19c38ae12f6e1e47e9d9fbd12d0a # v1.8.0 env: PSMODULE_INVOKE_PESTER_INPUT_Path: ${{ inputs.Path }} + PSMODULE_INVOKE_PESTER_INPUT_Pester_Version: ${{ inputs.Pester_Version }} + PSMODULE_INVOKE_PESTER_INPUT_Pester_Prerelease: ${{ inputs.Pester_Prerelease }} PSMODULE_INVOKE_PESTER_INPUT_Run_Path: ${{ inputs.Run_Path }} PSMODULE_INVOKE_PESTER_INPUT_Run_ExcludePath: ${{ inputs.Run_ExcludePath }} PSMODULE_INVOKE_PESTER_INPUT_Run_ScriptBlock: ${{ inputs.Run_ScriptBlock }} @@ -349,6 +361,8 @@ runs: working-directory: ${{ inputs.WorkingDirectory }} env: PSMODULE_INVOKE_PESTER_INPUT_ReportAsJson: ${{ inputs.ReportAsJson }} + PSMODULE_INVOKE_PESTER_INPUT_Pester_Version: ${{ inputs.Pester_Version }} + PSMODULE_INVOKE_PESTER_INPUT_Pester_Prerelease: ${{ inputs.Pester_Prerelease }} PSMODULE_INVOKE_PESTER_INPUT_Notice_Mode: ${{ inputs.Notice_Mode }} PSMODULE_INVOKE_PESTER_INPUT_StepSummary_Mode: ${{ inputs.StepSummary_Mode }} PSMODULE_INVOKE_PESTER_INPUT_StepSummary_ShowTestOverview: ${{ inputs.StepSummary_ShowTestOverview }} diff --git a/src/Helpers.psm1 b/src/Helpers.psm1 index 5cda07f2..733ea8eb 100644 --- a/src/Helpers.psm1 +++ b/src/Helpers.psm1 @@ -1283,10 +1283,14 @@ function Invoke-ProcessTestDirectory { function Install-PSResourceWithRetry { <# .SYNOPSIS - Installs a PowerShell module with retry mechanism + Installs a PowerShell module with a retry mechanism, then imports the installed version. .DESCRIPTION - Attempts to install a PowerShell module multiple times in case of failure + Attempts to install a PowerShell module multiple times in case of failure. When a version + constraint is supplied, the newest version satisfying it is installed; that exact version is + then imported so the loaded module is deterministic even when other versions (for example the + runner's preinstalled copy) are present on the machine. When no version is supplied, the latest + available version is installed. #> [CmdletBinding()] param ( @@ -1298,6 +1302,15 @@ function Install-PSResourceWithRetry { )] [string] $Name, + # Version of the module to install. Accepts an exact version or a NuGet version range, + # e.g. '[6.0.0,7.0.0)' to allow any 6.x. When empty, the latest available version is installed. + [Parameter()] + [string] $Version, + + # Allow installing prerelease versions. + [Parameter()] + [switch] $Prerelease, + # Number of times to retry installation, default is 5 [Parameter()] [int] $RetryCount = 5, @@ -1308,10 +1321,27 @@ function Install-PSResourceWithRetry { ) process { - Write-Output "Installing module: $Name" + $installParams = @{ + Name = $Name + Repository = 'PSGallery' + TrustRepository = $true + PassThru = $true + WarningAction = 'SilentlyContinue' + } + if (-not [string]::IsNullOrWhiteSpace($Version)) { + $installParams['Version'] = $Version + } + if ($Prerelease) { + $installParams['Prerelease'] = $true + } + + $label = [string]::IsNullOrWhiteSpace($Version) ? $Name : "$Name $Version" + Write-Output "Installing module: $label" + + $installed = $null for ($i = 0; $i -lt $RetryCount; $i++) { try { - Install-PSResource -Name $Name -WarningAction SilentlyContinue -TrustRepository -Repository PSGallery + $installed = Install-PSResource @installParams break } catch { Write-Warning "Installation of $Name failed with error: $_" @@ -1322,6 +1352,32 @@ function Install-PSResourceWithRetry { Start-Sleep -Seconds $RetryDelay } } - Import-Module -Name $Name + + # Resolve the exact version to import. Prefer what was just installed; if the resource was + # already present, Install-PSResource returns nothing, so fall back to the newest installed + # version that satisfies the requested constraint. + $resolved = $installed | Where-Object { $_.Name -eq $Name } | Sort-Object Version -Descending | Select-Object -First 1 + if (-not $resolved) { + $getParams = @{ Name = $Name; Verbose = $false; ErrorAction = 'SilentlyContinue' } + if (-not [string]::IsNullOrWhiteSpace($Version)) { + $getParams['Version'] = $Version + } + $resolved = Get-PSResource @getParams | Sort-Object Version -Descending | Select-Object -First 1 + } + + # Import into the global session state so the resolved version is the one every subsequent + # command (for example Invoke-Pester in exec.ps1) uses, instead of PowerShell auto-loading the + # highest version available on PSModulePath. + if ($resolved) { + Write-Output "Importing module: $Name $($resolved.Version)" + try { + Import-Module -Name $Name -RequiredVersion $resolved.Version -Force -Global -ErrorAction Stop + } catch { + Write-Warning "Could not import $Name version $($resolved.Version) explicitly: $_. Importing the latest available version instead." + Import-Module -Name $Name -Force -Global + } + } else { + Import-Module -Name $Name -Force -Global + } } } diff --git a/src/exec.ps1 b/src/exec.ps1 index ab0de546..26adb3cb 100644 --- a/src/exec.ps1 +++ b/src/exec.ps1 @@ -7,11 +7,14 @@ $PSStyle.OutputRendering = 'Ansi' '::group::Exec - Setup prerequisites' Import-Module "$PSScriptRoot/Helpers.psm1" -'Pester' | Install-PSResourceWithRetry +# Install Pester honoring the optional version constraint from the action input. An empty value installs the latest version. +$pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_Pester_Version +$pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_Pester_Prerelease -eq 'true' +Install-PSResourceWithRetry -Name 'Pester' -Version $pesterVersion -Prerelease:$pesterPrerelease '::endgroup::' '::group::Exec - Get test kit versions' -$pesterModule = Get-PSResource -Name Pester -Verbose:$false | Sort-Object Version -Descending | Select-Object -First 1 +$pesterModule = Get-Module -Name Pester | Sort-Object Version -Descending | Select-Object -First 1 [PSCustomObject]@{ PowerShell = $PSVersionTable.PSVersion.ToString() @@ -59,11 +62,13 @@ $testResults = Invoke-Pester -Configuration $configuration $PSStyle.OutputRendering = 'Ansi' '::group::Eval - Setup prerequisites' -'Pester', 'Hashtable', 'TimeSpan', 'Markdown' | Install-PSResourceWithRetry +# Reuse the Pester version constraint resolved during Exec setup. An empty value installs the latest version. +Install-PSResourceWithRetry -Name 'Pester' -Version $pesterVersion -Prerelease:$pesterPrerelease +'Hashtable', 'TimeSpan', 'Markdown' | Install-PSResourceWithRetry '::endgroup::' '::group::Eval - Get test kit versions' -$pesterModule = Get-PSResource -Name Pester -Verbose:$false | Sort-Object Version -Descending | Select-Object -First 1 +$pesterModule = Get-Module -Name Pester | Sort-Object Version -Descending | Select-Object -First 1 [PSCustomObject]@{ PowerShell = $PSVersionTable.PSVersion.ToString() diff --git a/src/init.ps1 b/src/init.ps1 index 990f9ac8..c965f231 100644 --- a/src/init.ps1 +++ b/src/init.ps1 @@ -3,11 +3,15 @@ param() LogGroup 'Init - Setup prerequisites' { Import-Module "$PSScriptRoot/Helpers.psm1" - 'Pester', 'Hashtable', 'TimeSpan', 'Markdown' | Install-PSResourceWithRetry + # Install Pester honoring the optional version constraint from the action input. An empty value installs the latest version. + $pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_Pester_Version + $pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_Pester_Prerelease -eq 'true' + Install-PSResourceWithRetry -Name 'Pester' -Version $pesterVersion -Prerelease:$pesterPrerelease + 'Hashtable', 'TimeSpan', 'Markdown' | Install-PSResourceWithRetry } LogGroup 'Init - Get test kit versions' { - $pesterModule = Get-PSResource -Name Pester -Verbose:$false | Sort-Object Version -Descending | Select-Object -First 1 + $pesterModule = Get-Module -Name Pester | Sort-Object Version -Descending | Select-Object -First 1 [PSCustomObject]@{ PowerShell = $PSVersionTable.PSVersion.ToString() From 96d6d88c2d606988551eb243b80a138aee407541 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Wed, 8 Jul 2026 23:51:37 +0200 Subject: [PATCH 02/10] Add Pester version constraint tests --- .github/workflows/Action-Test.yml | 72 +++++++++++++++++++ src/Helpers.psm1 | 12 ++-- .../Pester5Range/PesterVersion.Tests.ps1 | 12 ++++ .../Pester6Exact/PesterVersion.Tests.ps1 | 10 +++ tests/Test-ActionResults.ps1 | 14 ++++ 5 files changed, 113 insertions(+), 7 deletions(-) create mode 100644 tests/4-PesterVersionConstraints/Pester5Range/PesterVersion.Tests.ps1 create mode 100644 tests/4-PesterVersionConstraints/Pester6Exact/PesterVersion.Tests.ps1 diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index fb8609eb..992321aa 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -302,6 +302,68 @@ jobs: CONCLUSION: ${{ steps.action-test.conclusion }} run: tests/Show-Status.ps1 + ActionTestPester5RangeConstraint: + name: Action-Test - [Pester 5.x Range Constraint] + runs-on: ubuntu-latest + outputs: + Outcome: ${{ steps.action-test.outcome }} + Conclusion: ${{ steps.action-test.conclusion }} + Executed: ${{ steps.action-test.outputs.Executed }} + Result: ${{ steps.action-test.outputs.Result }} + + steps: + # Need to check out as part of the test, as its a local action + - name: Checkout repo + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Action-Test [Pester 5.x Range Constraint] + uses: ./ + id: action-test + with: + WorkingDirectory: tests/4-PesterVersionConstraints/Pester5Range + Pester_Version: '[5.0.0,6.0.0)' + TestResult_TestSuiteName: Pester5RangeConstraint + + - name: Status + shell: pwsh + env: + OUTCOME: ${{ steps.action-test.outcome }} + CONCLUSION: ${{ steps.action-test.conclusion }} + run: tests/Show-Status.ps1 + + ActionTestPester6ExactConstraint: + name: Action-Test - [Pester 6.0.0 Exact Constraint] + runs-on: ubuntu-latest + outputs: + Outcome: ${{ steps.action-test.outcome }} + Conclusion: ${{ steps.action-test.conclusion }} + Executed: ${{ steps.action-test.outputs.Executed }} + Result: ${{ steps.action-test.outputs.Result }} + + steps: + # Need to check out as part of the test, as its a local action + - name: Checkout repo + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Action-Test [Pester 6.0.0 Exact Constraint] + uses: ./ + id: action-test + with: + WorkingDirectory: tests/4-PesterVersionConstraints/Pester6Exact + Pester_Version: '6.0.0' + TestResult_TestSuiteName: Pester6ExactConstraint + + - name: Status + shell: pwsh + env: + OUTCOME: ${{ steps.action-test.outcome }} + CONCLUSION: ${{ steps.action-test.conclusion }} + run: tests/Show-Status.ps1 + CatchJob: name: Catch Job - Aggregate Status needs: @@ -314,6 +376,8 @@ jobs: - ActionTest2StandardPrescriptFile - ActionTest2StandardNoSummary - ActionTest3Advanced + - ActionTestPester5RangeConstraint + - ActionTestPester6ExactConstraint if: always() runs-on: ubuntu-latest steps: @@ -361,5 +425,13 @@ jobs: ACTIONTEST3ADVANCED_CONCLUSION: ${{ needs.ActionTest3Advanced.outputs.Conclusion }} ACTIONTEST3ADVANCED_EXECUTED: ${{ needs.ActionTest3Advanced.outputs.Executed }} ACTIONTEST3ADVANCED_RESULT: ${{ needs.ActionTest3Advanced.outputs.Result }} + ACTIONTESTPESTER5RANGECONSTRAINT_OUTCOME: ${{ needs.ActionTestPester5RangeConstraint.outputs.Outcome }} + ACTIONTESTPESTER5RANGECONSTRAINT_CONCLUSION: ${{ needs.ActionTestPester5RangeConstraint.outputs.Conclusion }} + ACTIONTESTPESTER5RANGECONSTRAINT_EXECUTED: ${{ needs.ActionTestPester5RangeConstraint.outputs.Executed }} + ACTIONTESTPESTER5RANGECONSTRAINT_RESULT: ${{ needs.ActionTestPester5RangeConstraint.outputs.Result }} + ACTIONTESTPESTER6EXACTCONSTRAINT_OUTCOME: ${{ needs.ActionTestPester6ExactConstraint.outputs.Outcome }} + ACTIONTESTPESTER6EXACTCONSTRAINT_CONCLUSION: ${{ needs.ActionTestPester6ExactConstraint.outputs.Conclusion }} + ACTIONTESTPESTER6EXACTCONSTRAINT_EXECUTED: ${{ needs.ActionTestPester6ExactConstraint.outputs.Executed }} + ACTIONTESTPESTER6EXACTCONSTRAINT_RESULT: ${{ needs.ActionTestPester6ExactConstraint.outputs.Result }} with: Script: tests/Test-ActionResults.ps1 diff --git a/src/Helpers.psm1 b/src/Helpers.psm1 index 733ea8eb..1a03a32a 100644 --- a/src/Helpers.psm1 +++ b/src/Helpers.psm1 @@ -1335,7 +1335,10 @@ function Install-PSResourceWithRetry { $installParams['Prerelease'] = $true } - $label = [string]::IsNullOrWhiteSpace($Version) ? $Name : "$Name $Version" + $label = $Name + if (-not [string]::IsNullOrWhiteSpace($Version)) { + $label = "$Name $Version" + } Write-Output "Installing module: $label" $installed = $null @@ -1370,12 +1373,7 @@ function Install-PSResourceWithRetry { # highest version available on PSModulePath. if ($resolved) { Write-Output "Importing module: $Name $($resolved.Version)" - try { - Import-Module -Name $Name -RequiredVersion $resolved.Version -Force -Global -ErrorAction Stop - } catch { - Write-Warning "Could not import $Name version $($resolved.Version) explicitly: $_. Importing the latest available version instead." - Import-Module -Name $Name -Force -Global - } + Import-Module -Name $Name -RequiredVersion $resolved.Version -Force -Global -ErrorAction Stop } else { Import-Module -Name $Name -Force -Global } diff --git a/tests/4-PesterVersionConstraints/Pester5Range/PesterVersion.Tests.ps1 b/tests/4-PesterVersionConstraints/Pester5Range/PesterVersion.Tests.ps1 new file mode 100644 index 00000000..be06522d --- /dev/null +++ b/tests/4-PesterVersionConstraints/Pester5Range/PesterVersion.Tests.ps1 @@ -0,0 +1,12 @@ +#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '5.0.0'; MaximumVersion = '5.*' } + +Describe 'Pester version constraint' { + It 'uses a Pester 5.x version resolved from the configured range' { + $module = Get-Module -Name Pester | Sort-Object Version -Descending | Select-Object -First 1 + + $module | Should -Not -Be $null + $module.Version.Major | Should -Be 5 + $module.Version | Should -BeGreaterOrEqual ([version]'5.0.0') + $module.Version | Should -BeLessThan ([version]'6.0.0') + } +} \ No newline at end of file diff --git a/tests/4-PesterVersionConstraints/Pester6Exact/PesterVersion.Tests.ps1 b/tests/4-PesterVersionConstraints/Pester6Exact/PesterVersion.Tests.ps1 new file mode 100644 index 00000000..359143a9 --- /dev/null +++ b/tests/4-PesterVersionConstraints/Pester6Exact/PesterVersion.Tests.ps1 @@ -0,0 +1,10 @@ +#Requires -Modules @{ ModuleName = 'Pester'; RequiredVersion = '6.0.0' } + +Describe 'Pester version constraint' { + It 'uses the exact configured Pester version' { + $module = Get-Module -Name Pester | Sort-Object Version -Descending | Select-Object -First 1 + + $module | Should -Not -Be $null + $module.Version | Should -Be ([version]'6.0.0') + } +} \ No newline at end of file diff --git a/tests/Test-ActionResults.ps1 b/tests/Test-ActionResults.ps1 index 30617525..5167d3ce 100644 --- a/tests/Test-ActionResults.ps1 +++ b/tests/Test-ActionResults.ps1 @@ -94,6 +94,20 @@ $jobs = @( Executed = @{ Actual = $env:ACTIONTEST3ADVANCED_EXECUTED; Expected = 'True' } Result = @{ Actual = $env:ACTIONTEST3ADVANCED_RESULT; Expected = 'Passed' } } + @{ + Name = 'Action-Test - [Pester 5.x Range Constraint]' + Outcome = @{ Actual = $env:ACTIONTESTPESTER5RANGECONSTRAINT_OUTCOME; Expected = 'success' } + Conclusion = @{ Actual = $env:ACTIONTESTPESTER5RANGECONSTRAINT_CONCLUSION; Expected = 'success' } + Executed = @{ Actual = $env:ACTIONTESTPESTER5RANGECONSTRAINT_EXECUTED; Expected = 'True' } + Result = @{ Actual = $env:ACTIONTESTPESTER5RANGECONSTRAINT_RESULT; Expected = 'Passed' } + } + @{ + Name = 'Action-Test - [Pester 6.0.0 Exact Constraint]' + Outcome = @{ Actual = $env:ACTIONTESTPESTER6EXACTCONSTRAINT_OUTCOME; Expected = 'success' } + Conclusion = @{ Actual = $env:ACTIONTESTPESTER6EXACTCONSTRAINT_CONCLUSION; Expected = 'success' } + Executed = @{ Actual = $env:ACTIONTESTPESTER6EXACTCONSTRAINT_EXECUTED; Expected = 'True' } + Result = @{ Actual = $env:ACTIONTESTPESTER6EXACTCONSTRAINT_RESULT; Expected = 'Passed' } + } ) # Add Pass property to each check and convert to PSCustomObject for table output From 0aaa84eccf884e4d759e1afa2ab5e8acc8394755 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 9 Jul 2026 00:26:30 +0200 Subject: [PATCH 03/10] Use PascalCase Pester inputs --- .github/workflows/Action-Test.yml | 4 ++-- README.md | 6 +++--- action.yml | 12 ++++++------ src/exec.ps1 | 4 ++-- src/init.ps1 | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 992321aa..4dffbc0c 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -323,7 +323,7 @@ jobs: id: action-test with: WorkingDirectory: tests/4-PesterVersionConstraints/Pester5Range - Pester_Version: '[5.0.0,6.0.0)' + PesterVersion: '[5.0.0,6.0.0)' TestResult_TestSuiteName: Pester5RangeConstraint - name: Status @@ -354,7 +354,7 @@ jobs: id: action-test with: WorkingDirectory: tests/4-PesterVersionConstraints/Pester6Exact - Pester_Version: '6.0.0' + PesterVersion: '6.0.0' TestResult_TestSuiteName: Pester6ExactConstraint - name: Status diff --git a/README.md b/README.md index dac47705..eaf4accf 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ If you specify `CodeCoverage_Enabled: true` here, it will enable coverage even i 1. **Prerequisite Setup** - Installs required PowerShell modules if they're not present. - - Installs Pester at the latest version by default, or the version matching the `Pester_Version` constraint when set. + - Installs Pester at the latest version by default, or the version matching the `PesterVersion` constraint when set. - Imports the exact installed Pester version so the version that runs is deterministic, even when the runner ships a different preinstalled Pester. - Imports the modules so the testing framework is ready to use. 2. **Loading Inputs and Configuration** @@ -264,8 +264,8 @@ jobs: | **Input** | **Description** | **Default** | |--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------| | `Path` | Path to where tests are located or a configuration file. | *(none)* | -| `Pester_Version` | Version of Pester to install (NuGet range, e.g. `[6.0.0,7.0.0)` for any 6.x). Empty installs the latest version. | *(none)* | -| `Pester_Prerelease` | Allow installing prerelease versions of Pester. | `false` | +| `PesterVersion` | Version of Pester to install (NuGet range, e.g. `[6.0.0,7.0.0)` for any 6.x). Empty installs the latest version. | *(none)* | +| `PesterPrerelease` | Allow installing prerelease versions of Pester. | `false` | | `ReportAsJson` | Output generated reports in JSON format in addition to the configured format through Pester. | `true` | | `Prescript` | Script to be executed before the test run. This script is executed in the same context as the test run. | *(none)* | | `Notice_Mode` | Controls when to show notices for test completion.
  • `Full` - show on success and failure
  • `Failed` - show only on failure
  • `None` - disable notices
| `Failed` | diff --git a/action.yml b/action.yml index 8c2d70ca..002be3f7 100644 --- a/action.yml +++ b/action.yml @@ -10,12 +10,12 @@ inputs: description: | Path to where tests are located or a configuration file. required: false - Pester_Version: + PesterVersion: description: | Version of the Pester module to install, using NuGet version-range syntax, e.g. '[6.0.0,7.0.0)' to allow any 6.x. A single value such as '6.4.0' installs that exact version. When empty, the latest available version is installed. required: false - Pester_Prerelease: + PesterPrerelease: description: | Allow installing prerelease versions of Pester. required: false @@ -298,8 +298,8 @@ runs: uses: PSModule/GitHub-Script@1ee97bbc652d19c38ae12f6e1e47e9d9fbd12d0a # v1.8.0 env: PSMODULE_INVOKE_PESTER_INPUT_Path: ${{ inputs.Path }} - PSMODULE_INVOKE_PESTER_INPUT_Pester_Version: ${{ inputs.Pester_Version }} - PSMODULE_INVOKE_PESTER_INPUT_Pester_Prerelease: ${{ inputs.Pester_Prerelease }} + PSMODULE_INVOKE_PESTER_INPUT_PesterVersion: ${{ inputs.PesterVersion }} + PSMODULE_INVOKE_PESTER_INPUT_PesterPrerelease: ${{ inputs.PesterPrerelease }} PSMODULE_INVOKE_PESTER_INPUT_Run_Path: ${{ inputs.Run_Path }} PSMODULE_INVOKE_PESTER_INPUT_Run_ExcludePath: ${{ inputs.Run_ExcludePath }} PSMODULE_INVOKE_PESTER_INPUT_Run_ScriptBlock: ${{ inputs.Run_ScriptBlock }} @@ -361,8 +361,8 @@ runs: working-directory: ${{ inputs.WorkingDirectory }} env: PSMODULE_INVOKE_PESTER_INPUT_ReportAsJson: ${{ inputs.ReportAsJson }} - PSMODULE_INVOKE_PESTER_INPUT_Pester_Version: ${{ inputs.Pester_Version }} - PSMODULE_INVOKE_PESTER_INPUT_Pester_Prerelease: ${{ inputs.Pester_Prerelease }} + PSMODULE_INVOKE_PESTER_INPUT_PesterVersion: ${{ inputs.PesterVersion }} + PSMODULE_INVOKE_PESTER_INPUT_PesterPrerelease: ${{ inputs.PesterPrerelease }} PSMODULE_INVOKE_PESTER_INPUT_Notice_Mode: ${{ inputs.Notice_Mode }} PSMODULE_INVOKE_PESTER_INPUT_StepSummary_Mode: ${{ inputs.StepSummary_Mode }} PSMODULE_INVOKE_PESTER_INPUT_StepSummary_ShowTestOverview: ${{ inputs.StepSummary_ShowTestOverview }} diff --git a/src/exec.ps1 b/src/exec.ps1 index 26adb3cb..f1bb706c 100644 --- a/src/exec.ps1 +++ b/src/exec.ps1 @@ -8,8 +8,8 @@ $PSStyle.OutputRendering = 'Ansi' '::group::Exec - Setup prerequisites' Import-Module "$PSScriptRoot/Helpers.psm1" # Install Pester honoring the optional version constraint from the action input. An empty value installs the latest version. -$pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_Pester_Version -$pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_Pester_Prerelease -eq 'true' +$pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_PesterVersion +$pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_PesterPrerelease -eq 'true' Install-PSResourceWithRetry -Name 'Pester' -Version $pesterVersion -Prerelease:$pesterPrerelease '::endgroup::' diff --git a/src/init.ps1 b/src/init.ps1 index c965f231..4e940e29 100644 --- a/src/init.ps1 +++ b/src/init.ps1 @@ -4,8 +4,8 @@ param() LogGroup 'Init - Setup prerequisites' { Import-Module "$PSScriptRoot/Helpers.psm1" # Install Pester honoring the optional version constraint from the action input. An empty value installs the latest version. - $pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_Pester_Version - $pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_Pester_Prerelease -eq 'true' + $pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_PesterVersion + $pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_PesterPrerelease -eq 'true' Install-PSResourceWithRetry -Name 'Pester' -Version $pesterVersion -Prerelease:$pesterPrerelease 'Hashtable', 'TimeSpan', 'Markdown' | Install-PSResourceWithRetry } From c7ec2f92b41aa46a24bcd75c8b935e4f055093ab Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 9 Jul 2026 00:35:25 +0200 Subject: [PATCH 04/10] Document latest as PesterVersion default --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eaf4accf..a7db3153 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,7 @@ jobs: | **Input** | **Description** | **Default** | |--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------| | `Path` | Path to where tests are located or a configuration file. | *(none)* | -| `PesterVersion` | Version of Pester to install (NuGet range, e.g. `[6.0.0,7.0.0)` for any 6.x). Empty installs the latest version. | *(none)* | +| `PesterVersion` | Version of Pester to install (NuGet range, e.g. `[6.0.0,7.0.0)` for any 6.x). Empty installs the latest version. | `latest` | | `PesterPrerelease` | Allow installing prerelease versions of Pester. | `false` | | `ReportAsJson` | Output generated reports in JSON format in addition to the configured format through Pester. | `true` | | `Prescript` | Script to be executed before the test run. This script is executed in the same context as the test run. | *(none)* | From b1f96db76b702a42be4aa10ff655e44db7675668 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 9 Jul 2026 01:52:57 +0200 Subject: [PATCH 05/10] Use Version inputs for Pester --- .github/workflows/Action-Test.yml | 4 ++-- README.md | 10 +++++----- action.yml | 28 +++++++++++++++------------- src/exec.ps1 | 4 ++-- src/init.ps1 | 4 ++-- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 4dffbc0c..901ff989 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -323,7 +323,7 @@ jobs: id: action-test with: WorkingDirectory: tests/4-PesterVersionConstraints/Pester5Range - PesterVersion: '[5.0.0,6.0.0)' + Version: '[5.0.0,6.0.0)' TestResult_TestSuiteName: Pester5RangeConstraint - name: Status @@ -354,7 +354,7 @@ jobs: id: action-test with: WorkingDirectory: tests/4-PesterVersionConstraints/Pester6Exact - PesterVersion: '6.0.0' + Version: '6.0.0' TestResult_TestSuiteName: Pester6ExactConstraint - name: Status diff --git a/README.md b/README.md index a7db3153..1defd0bb 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ If you specify `CodeCoverage_Enabled: true` here, it will enable coverage even i 1. **Prerequisite Setup** - Installs required PowerShell modules if they're not present. - - Installs Pester at the latest version by default, or the version matching the `PesterVersion` constraint when set. + - Installs Pester at the latest version by default, or the version matching the `Version` constraint when set. - Imports the exact installed Pester version so the version that runs is deterministic, even when the runner ships a different preinstalled Pester. - Imports the modules so the testing framework is ready to use. 2. **Loading Inputs and Configuration** @@ -264,8 +264,8 @@ jobs: | **Input** | **Description** | **Default** | |--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------| | `Path` | Path to where tests are located or a configuration file. | *(none)* | -| `PesterVersion` | Version of Pester to install (NuGet range, e.g. `[6.0.0,7.0.0)` for any 6.x). Empty installs the latest version. | `latest` | -| `PesterPrerelease` | Allow installing prerelease versions of Pester. | `false` | +| `Version` | Version of Pester to install (NuGet range, e.g. `[6.0.0,7.0.0)` for any 6.x). Empty installs the latest version. | `latest` | +| `Prerelease` | Allow installing prerelease versions of Pester. | `false` | | `ReportAsJson` | Output generated reports in JSON format in addition to the configured format through Pester. | `true` | | `Prescript` | Script to be executed before the test run. This script is executed in the same context as the test run. | *(none)* | | `Notice_Mode` | Controls when to show notices for test completion.
  • `Full` - show on success and failure
  • `Failed` - show only on failure
  • `None` - disable notices
| `Failed` | @@ -316,8 +316,8 @@ jobs: | `TestRegistry_Enabled` | Enable `TestRegistry`. | *(none)* | | `Debug` | Enable debug output. | `false` | | `Verbose` | Enable verbose output. | `false` | -| `Version` | Specifies the exact version of the GitHub module to install. | *(none)* | -| `Prerelease` | Allow prerelease versions if available. | `false` | +| `GitHubVersion` | Version of the GitHub module to install during init bootstrap (NuGet range, e.g. `[1.8.0,2.0.0)`). Empty installs latest. | `latest` | +| `GitHubPrerelease` | Allow installing prerelease versions of the GitHub module. | `false` | | `WorkingDirectory` | The working directory where the script runs. | `.` | ### Outputs diff --git a/action.yml b/action.yml index 002be3f7..bd034499 100644 --- a/action.yml +++ b/action.yml @@ -10,12 +10,12 @@ inputs: description: | Path to where tests are located or a configuration file. required: false - PesterVersion: + Version: description: | Version of the Pester module to install, using NuGet version-range syntax, e.g. '[6.0.0,7.0.0)' to allow any 6.x. - A single value such as '6.4.0' installs that exact version. When empty, the latest available version is installed. + A bare version such as '6.4.0' installs that exact version. When empty, the latest available version is installed. required: false - PesterPrerelease: + Prerelease: description: | Allow installing prerelease versions of Pester. required: false @@ -229,11 +229,13 @@ inputs: description: Enable verbose output. required: false default: 'false' - Version: - description: Specifies the version of the GitHub module to be installed. The value must be an exact version. + GitHubVersion: + description: | + Version of the GitHub module to install during the init bootstrap step, using NuGet version-range syntax. + A bare version such as '1.8.0' installs that exact version. When empty, the latest available version is installed. required: false - Prerelease: - description: Allow prerelease versions if available. + GitHubPrerelease: + description: Allow installing prerelease versions of the GitHub module. required: false default: 'false' WorkingDirectory: @@ -298,8 +300,8 @@ runs: uses: PSModule/GitHub-Script@1ee97bbc652d19c38ae12f6e1e47e9d9fbd12d0a # v1.8.0 env: PSMODULE_INVOKE_PESTER_INPUT_Path: ${{ inputs.Path }} - PSMODULE_INVOKE_PESTER_INPUT_PesterVersion: ${{ inputs.PesterVersion }} - PSMODULE_INVOKE_PESTER_INPUT_PesterPrerelease: ${{ inputs.PesterPrerelease }} + PSMODULE_INVOKE_PESTER_INPUT_Version: ${{ inputs.Version }} + PSMODULE_INVOKE_PESTER_INPUT_Prerelease: ${{ inputs.Prerelease }} PSMODULE_INVOKE_PESTER_INPUT_Run_Path: ${{ inputs.Run_Path }} PSMODULE_INVOKE_PESTER_INPUT_Run_ExcludePath: ${{ inputs.Run_ExcludePath }} PSMODULE_INVOKE_PESTER_INPUT_Run_ScriptBlock: ${{ inputs.Run_ScriptBlock }} @@ -346,9 +348,9 @@ runs: ShowInfo: false ShowOutput: true Debug: ${{ inputs.Debug }} - Prerelease: ${{ inputs.Prerelease }} + Prerelease: ${{ inputs.GitHubPrerelease }} Verbose: ${{ inputs.Verbose }} - Version: ${{ inputs.Version }} + Version: ${{ inputs.GitHubVersion }} WorkingDirectory: ${{ inputs.WorkingDirectory }} Name: Invoke-Pester Script: | @@ -361,8 +363,8 @@ runs: working-directory: ${{ inputs.WorkingDirectory }} env: PSMODULE_INVOKE_PESTER_INPUT_ReportAsJson: ${{ inputs.ReportAsJson }} - PSMODULE_INVOKE_PESTER_INPUT_PesterVersion: ${{ inputs.PesterVersion }} - PSMODULE_INVOKE_PESTER_INPUT_PesterPrerelease: ${{ inputs.PesterPrerelease }} + PSMODULE_INVOKE_PESTER_INPUT_Version: ${{ inputs.Version }} + PSMODULE_INVOKE_PESTER_INPUT_Prerelease: ${{ inputs.Prerelease }} PSMODULE_INVOKE_PESTER_INPUT_Notice_Mode: ${{ inputs.Notice_Mode }} PSMODULE_INVOKE_PESTER_INPUT_StepSummary_Mode: ${{ inputs.StepSummary_Mode }} PSMODULE_INVOKE_PESTER_INPUT_StepSummary_ShowTestOverview: ${{ inputs.StepSummary_ShowTestOverview }} diff --git a/src/exec.ps1 b/src/exec.ps1 index f1bb706c..2f7c6b0e 100644 --- a/src/exec.ps1 +++ b/src/exec.ps1 @@ -8,8 +8,8 @@ $PSStyle.OutputRendering = 'Ansi' '::group::Exec - Setup prerequisites' Import-Module "$PSScriptRoot/Helpers.psm1" # Install Pester honoring the optional version constraint from the action input. An empty value installs the latest version. -$pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_PesterVersion -$pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_PesterPrerelease -eq 'true' +$pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_Version +$pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_Prerelease -eq 'true' Install-PSResourceWithRetry -Name 'Pester' -Version $pesterVersion -Prerelease:$pesterPrerelease '::endgroup::' diff --git a/src/init.ps1 b/src/init.ps1 index 4e940e29..6d2f3a79 100644 --- a/src/init.ps1 +++ b/src/init.ps1 @@ -4,8 +4,8 @@ param() LogGroup 'Init - Setup prerequisites' { Import-Module "$PSScriptRoot/Helpers.psm1" # Install Pester honoring the optional version constraint from the action input. An empty value installs the latest version. - $pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_PesterVersion - $pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_PesterPrerelease -eq 'true' + $pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_Version + $pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_Prerelease -eq 'true' Install-PSResourceWithRetry -Name 'Pester' -Version $pesterVersion -Prerelease:$pesterPrerelease 'Hashtable', 'TimeSpan', 'Markdown' | Install-PSResourceWithRetry } From 715d2caeddadd31b24db2ada5b7f2487c5bf8800 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 9 Jul 2026 04:28:56 +0200 Subject: [PATCH 06/10] Bump PSModule/GitHub-Script from 1.8.0 to 1.9.0 (#72) Bumps [PSModule/GitHub-Script](https://github.com/PSModule/GitHub-Script) from 1.8.0 to 1.9.0. - Pin: `8083ec1f733f00357ee4d0db0c6056686e483bc0` (`# v1.9.0`) - Release notes: https://github.com/PSModule/GitHub-Script/releases/tag/v1.9.0 Co-authored-by: Marius Storhaug --- .github/workflows/Action-Test.yml | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 901ff989..8c8d456f 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -387,7 +387,7 @@ jobs: persist-credentials: false - name: Display Aggregated Results as a Table - uses: PSModule/GitHub-Script@1ee97bbc652d19c38ae12f6e1e47e9d9fbd12d0a # v1.8.0 + uses: PSModule/GitHub-Script@8083ec1f733f00357ee4d0db0c6056686e483bc0 # v1.9.0 env: ACTIONTEST1SIMPLE_OUTCOME: ${{ needs.ActionTest1Simple.outputs.Outcome }} ACTIONTEST1SIMPLE_CONCLUSION: ${{ needs.ActionTest1Simple.outputs.Conclusion }} diff --git a/action.yml b/action.yml index bd034499..f0e7f499 100644 --- a/action.yml +++ b/action.yml @@ -297,7 +297,7 @@ runs: using: composite steps: - name: Invoke-Pester (init) - uses: PSModule/GitHub-Script@1ee97bbc652d19c38ae12f6e1e47e9d9fbd12d0a # v1.8.0 + uses: PSModule/GitHub-Script@8083ec1f733f00357ee4d0db0c6056686e483bc0 # v1.9.0 env: PSMODULE_INVOKE_PESTER_INPUT_Path: ${{ inputs.Path }} PSMODULE_INVOKE_PESTER_INPUT_Version: ${{ inputs.Version }} From bdfd226e250cabacf22d615b0d52705d8bf7c10a Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 9 Jul 2026 13:15:42 +0200 Subject: [PATCH 07/10] Fail fast when Pester constraint resolves nothing; fix input default docs Address Copilot review threads on PR #71: - Helpers.psm1: when -Version is set but no satisfying installed version resolves, throw instead of silently importing an unconstrained module from PSModulePath (defeats deterministic selection, issue #68). Add -ErrorAction Stop to the unconstrained fallback so a missing module surfaces clearly. - README.md: the Version and GitHubVersion inputs have no action.yml default; correct the Default column from 'latest' to *(none)* (behavior 'empty installs latest' is already in the description) so users don't literally set Version: latest. --- README.md | 4 ++-- src/Helpers.psm1 | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1defd0bb..5df868bb 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,7 @@ jobs: | **Input** | **Description** | **Default** | |--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------| | `Path` | Path to where tests are located or a configuration file. | *(none)* | -| `Version` | Version of Pester to install (NuGet range, e.g. `[6.0.0,7.0.0)` for any 6.x). Empty installs the latest version. | `latest` | +| `Version` | Version of Pester to install (NuGet range, e.g. `[6.0.0,7.0.0)` for any 6.x). Empty installs the latest version. | *(none)* | | `Prerelease` | Allow installing prerelease versions of Pester. | `false` | | `ReportAsJson` | Output generated reports in JSON format in addition to the configured format through Pester. | `true` | | `Prescript` | Script to be executed before the test run. This script is executed in the same context as the test run. | *(none)* | @@ -316,7 +316,7 @@ jobs: | `TestRegistry_Enabled` | Enable `TestRegistry`. | *(none)* | | `Debug` | Enable debug output. | `false` | | `Verbose` | Enable verbose output. | `false` | -| `GitHubVersion` | Version of the GitHub module to install during init bootstrap (NuGet range, e.g. `[1.8.0,2.0.0)`). Empty installs latest. | `latest` | +| `GitHubVersion` | Version of the GitHub module to install during init bootstrap (NuGet range, e.g. `[1.8.0,2.0.0)`). Empty installs latest. | *(none)* | | `GitHubPrerelease` | Allow installing prerelease versions of the GitHub module. | `false` | | `WorkingDirectory` | The working directory where the script runs. | `.` | diff --git a/src/Helpers.psm1 b/src/Helpers.psm1 index 1a03a32a..69f02d43 100644 --- a/src/Helpers.psm1 +++ b/src/Helpers.psm1 @@ -1374,8 +1374,14 @@ function Install-PSResourceWithRetry { if ($resolved) { Write-Output "Importing module: $Name $($resolved.Version)" Import-Module -Name $Name -RequiredVersion $resolved.Version -Force -Global -ErrorAction Stop + } elseif (-not [string]::IsNullOrWhiteSpace($Version)) { + # A version constraint was requested but no satisfying installed version could be resolved. Importing the + # module unconstrained here would silently load an arbitrary copy from PSModulePath (for example the + # runner's preinstalled module), defeating the deterministic, constraint-driven selection this function + # exists to guarantee. Fail fast instead. + throw "Unable to resolve an installed '$Name' version satisfying the requested constraint '$Version'. Refusing to import an unconstrained version to keep the loaded module deterministic." } else { - Import-Module -Name $Name -Force -Global + Import-Module -Name $Name -Force -Global -ErrorAction Stop } } } From 670be31dedb91a10ad909509f07a843eac0a8bee Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 9 Jul 2026 13:21:10 +0200 Subject: [PATCH 08/10] Shorten fail-fast throw message to satisfy PSAvoidLongLines (150) The repo PSScriptAnalyzer settings (.github/linters/.powershell-psscriptanalyzer.psd1) enforce PSAvoidLongLines with a 150-char max; the new throw line was 199 chars and failed the POWERSHELL super-linter. Shortened to a single 126-char message; the rationale remains in the preceding comment. --- src/Helpers.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helpers.psm1 b/src/Helpers.psm1 index 69f02d43..e6646a66 100644 --- a/src/Helpers.psm1 +++ b/src/Helpers.psm1 @@ -1379,7 +1379,7 @@ function Install-PSResourceWithRetry { # module unconstrained here would silently load an arbitrary copy from PSModulePath (for example the # runner's preinstalled module), defeating the deterministic, constraint-driven selection this function # exists to guarantee. Fail fast instead. - throw "Unable to resolve an installed '$Name' version satisfying the requested constraint '$Version'. Refusing to import an unconstrained version to keep the loaded module deterministic." + throw "No installed '$Name' version satisfies constraint '$Version'; refusing to import an unconstrained version." } else { Import-Module -Name $Name -Force -Global -ErrorAction Stop } From a7c247854bb8d88da4e82504f44d6d240109d8ef Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 9 Jul 2026 13:38:37 +0200 Subject: [PATCH 09/10] maintenance: rename helper module to Invoke-Pester.Helpers Aligns with the action helper-module naming standard: name the module after the action, not the generic Helpers. Invoke-Pester loads the shared framework Helpers module into the test session, so its own Helpers module was the primary source of the name collision that broke -ModuleName mocking in tested modules. Renames src/Helpers.psm1 to src/Invoke-Pester.Helpers.psm1 and updates the exec.ps1 and init.ps1 imports; keeps the framework Helpers usage (LogGroup). No runtime logic changed. Part of PSModule/Process-PSModule#364. --- src/{Helpers.psm1 => Invoke-Pester.Helpers.psm1} | 0 src/exec.ps1 | 2 +- src/init.ps1 | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/{Helpers.psm1 => Invoke-Pester.Helpers.psm1} (100%) diff --git a/src/Helpers.psm1 b/src/Invoke-Pester.Helpers.psm1 similarity index 100% rename from src/Helpers.psm1 rename to src/Invoke-Pester.Helpers.psm1 diff --git a/src/exec.ps1 b/src/exec.ps1 index 2f7c6b0e..66b19e1c 100644 --- a/src/exec.ps1 +++ b/src/exec.ps1 @@ -6,7 +6,7 @@ $VerbosePreference = $env:PSMODULE_INVOKE_PESTER_INPUT_Verbose -eq 'true' ? 'Con $PSStyle.OutputRendering = 'Ansi' '::group::Exec - Setup prerequisites' -Import-Module "$PSScriptRoot/Helpers.psm1" +Import-Module "$PSScriptRoot/Invoke-Pester.Helpers.psm1" # Install Pester honoring the optional version constraint from the action input. An empty value installs the latest version. $pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_Version $pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_Prerelease -eq 'true' diff --git a/src/init.ps1 b/src/init.ps1 index 6d2f3a79..d1a7f25c 100644 --- a/src/init.ps1 +++ b/src/init.ps1 @@ -2,7 +2,7 @@ param() LogGroup 'Init - Setup prerequisites' { - Import-Module "$PSScriptRoot/Helpers.psm1" + Import-Module "$PSScriptRoot/Invoke-Pester.Helpers.psm1" # Install Pester honoring the optional version constraint from the action input. An empty value installs the latest version. $pesterVersion = $env:PSMODULE_INVOKE_PESTER_INPUT_Version $pesterPrerelease = $env:PSMODULE_INVOKE_PESTER_INPUT_Prerelease -eq 'true' From 0f183f0245cf356c2885561ac141fad09ee2792e Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 9 Jul 2026 14:53:23 +0200 Subject: [PATCH 10/10] Fix grammar in Action-Test checkout comments (its to it's) Copilot flagged that its should be it is (contraction) in two checkout-step comments; the same typo appears in all 11 test jobs, so corrected every occurrence for consistency. --- .github/workflows/Action-Test.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 8c8d456f..72da746b 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -27,7 +27,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -58,7 +58,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -89,7 +89,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -121,7 +121,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -153,7 +153,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -183,7 +183,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -218,7 +218,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -250,7 +250,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -281,7 +281,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -312,7 +312,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -343,7 +343,7 @@ jobs: Result: ${{ steps.action-test.outputs.Result }} steps: - # Need to check out as part of the test, as its a local action + # Need to check out as part of the test, as it's a local action - name: Checkout repo uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: