[release/v7.4.15] Fix a preview detection test for the packaging script#27226
Merged
daxian-dbw merged 1 commit intoApr 9, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the packaging Pester tests on release/v7.4.15 to validate preview detection behavior (including preview/RC versions) without changing shipped product code.
Changes:
- Refactors the “package name for preview detection” verification into a parameterized Pester test using
-TestCases. - Expands coverage to include both
*-preview.*and*-rc.*version strings.
| $incorrectCheck = $Name -like '*-preview' | ||
| $incorrectCheck | Should -Be $false -Because "Package name is 'powershell' not 'powershell-preview'" | ||
|
|
||
| param($Version) |
There was a problem hiding this comment.
-TestCases supplies both Version and Name, but the test block only declares param($Version). In Pester, test case hashtables are splatted into the test scriptblock, so the extra Name key can cause a parameter-binding error. Either add $Name to the param block (even if only for the test name) or remove Name from the test cases and use <Version> in the title instead.
Suggested change
| param($Version) | |
| param($Version, $Name) |
SeeminglyScience
approved these changes
Apr 9, 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 #26882 to release/v7.4.15
Triggered by @daxian-dbw on behalf of @daxian-dbw
Original CL Label: CL-BuildPackaging
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
Adjusts the packaging test for preview detection so the release/v7.4.15 branch validates the intended packaging behavior without changing shipped product code.
Customer Impact
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
This backport is test-only. The original change updated packaging test expectations for preview detection, the cherry-pick applied cleanly to release/v7.4.15, and CI on the backport PR will validate the packaging test suite on the release branch.
Risk
REQUIRED: Check exactly one box.
Low risk because the change only updates a packaging test and does not affect runtime or shipped binaries.