Pin Pester to exact version and use approved PowerShell verbs#71
Merged
blindzero merged 3 commits intoissues/68-ci-add-PSScriptAnalyzer-linting-with-repo-settingsfrom Jan 10, 2026
Conversation
3 tasks
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] Address feedback on CI quality gates PR
Pin Pester to exact version for supply-chain security
Jan 10, 2026
Owner
|
@copilot Change Ensure-* functions to use approved verbs as well |
…erbs Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Contributor
Author
Fixed in 7818a34. Renamed all
All function calls updated accordingly in both |
Copilot
AI
changed the title
Pin Pester to exact version for supply-chain security
Pin Pester to exact version and use approved PowerShell verbs
Jan 10, 2026
blindzero
approved these changes
Jan 10, 2026
41c14b1
into
issues/68-ci-add-PSScriptAnalyzer-linting-with-repo-settings
5 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pin Pester module to specific version (5.7.1) using
-RequiredVersionto prevent automatic upgrades to potentially compromised versions during CI/local test runs. Additionally, refactor helper functions to use approved PowerShell verbs.Motivation
The previous implementation used
-MinimumVersion, allowing automatic upgrades to any newer Pester version from the PowerShell Gallery. If the module or gallery were compromised, malicious code satisfyingPester >= $MinimumVersionwould execute with repository access and CI permissions, creating a supply-chain attack vector.Additionally, helper functions used the non-approved verb
Ensure, which violates PowerShell naming best practices.Type of Change
Changes
MinimumPesterVersion→PesterVersion(matchesPSScriptAnalyzerVersionpattern)Initialize-Pesterfunction (formerlyEnsure-Pester) to enforce exact version matching:Install-Module -MinimumVersion→-RequiredVersionImport-Module -MinimumVersion→-RequiredVersion$pester.Version -lt $MinimumVersion→$_.Version -eq $RequiredVersion-AllowClobberflag for consistency withInitialize-ModulepatternInitialize:Ensure-Directory→Initialize-Directory(in both tool scripts)Ensure-Pester→Initialize-Pester(in Invoke-IdlePesterTests.ps1)Ensure-Module→Initialize-Module(in Invoke-IdleScriptAnalyzer.ps1)Before:
After:
Testing
How to test & review
Run
./tools/Invoke-IdlePesterTests.ps1and./tools/Invoke-IdleScriptAnalyzer.ps1- verify they use Pester 5.7.1 exactly, do not attempt to upgrade, and all function names use approved PowerShell verbs.Checklist
Related Issues
Addresses feedback from #70
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.