[release/v7.4] Update the Update-Help tests to use -Force to remove read-only files#26786
Merged
TravisEz13 merged 2 commits intoPowerShell:release/v7.4from Feb 13, 2026
Conversation
TravisEz13
commented
Feb 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Backport to release/v7.4 improving reliability of the Update-Help Pester tests by making test cleanup resilient to read-only help files (reducing noisy non-terminating errors in CI).
Changes:
- Update test cleanup to remove help content directories with
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue. - Make
Update-Helpfailures terminating in this test by adding-ErrorAction Stop.
jshigetomi
approved these changes
Feb 12, 2026
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.
Backport of #26780 to release/v7.4
Triggered by @TravisEz13 on behalf of @daxian-dbw
Original CL Label: CL-Test
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
This fixes CI test infrastructure failures caused by inability to remove read-only files in help content folders during test cleanup. Without this fix, Update-Help tests produce numerous non-terminating errors that clutter test output and could mask real test failures.
Customer Impact
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
The fix modifies test cleanup code to use -Force parameter when removing help content directories. This allows tests to remove read-only files that were previously causing non-terminating errors. The tests themselves verify the Update-Help cmdlet functionality works correctly after cleanup.
Risk
REQUIRED: Check exactly one box.
Low risk as this only modifies test code, not production code. The change improves test reliability by properly cleaning up read-only files during test execution. No impact to end users or runtime behavior.
Merge Conflicts
One file had conflicts during cherry-pick: test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1. Conflict was due to the Update-Help command line having -ErrorAction Stop in master but not in release/v7.4. Resolution: Applied both the PR's main fix (-Force -ErrorAction SilentlyContinue to Remove-Item) and included the -ErrorAction Stop on Update-Help to match master for consistency.