Fix PowerShell Pester tests for v5 compatibility and update pre-commit hook#16
Conversation
… paths Co-authored-by: AprilDeFeu <36605389+AprilDeFeu@users.noreply.github.com>
|
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 I added the website cdn.powershellgallery.com to your whitelist, you should have access now. Try to finish the task |
Co-authored-by: AprilDeFeu <36605389+AprilDeFeu@users.noreply.github.com>
Task completed! I've successfully updated the pre-commit hook to use Pester v5 configuration API, fixed the test result format issue (was XML with .json extension), and added proper environment variable setup. All 14 PowerShell tests now pass, and all pre-commit hooks are working correctly. (commit: b86ba8c) |
|
@copilot Add directory creation to this pre-commit hook then |
PowerShell tests were failing due to legacy Pester v3/v4 syntax incompatible with Pester v5.
Changes
Should BetoShould -Besyntax (14 instances)F:\April\Scripts\...::set-outputwith$env:GITHUB_OUTPUT.githooks/pre-commit.ps1from legacy Pester v4 parameters to Pester v5 configuration API.jsonto.xml(was XML content with incorrect extension)SCRIPTS_ROOTenvironment variable setup in pre-commit hook for proper test discoverytests/results/to.gitignoreto exclude test artifacts from version controlAll 14 tests now pass on Pester v5, and all pre-commit hooks execute successfully.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.