fix(install): qualify Windows archive extraction - #652
Open
codywilliamson wants to merge 1 commit into
Open
Conversation
Use the Microsoft.PowerShell.Archive cmdlet explicitly so modules such as Pscx cannot shadow the installer extraction command. Add a focused Windows regression test for both installer variants.\n\nFixes slackapi#651.
|
Thanks for the contribution! Before we can merge this, we need @codywilliamson to sign the Salesforce Inc. Contributor License Agreement. |
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.
Changelog
The Windows installer now extracts the CLI reliably when another PowerShell module defines
Expand-Archive.Summary
PowerShell resolves an unqualified command name before binding its parameters. When Pscx 3.3.2 is loaded, the installer selects Pscx's
Expand-Archive, which does not accept-DestinationPath; the ZIP downloads successfully, but extraction and the PATH update never happen. Both release and development installers now addressMicrosoft.PowerShell.Archiveexplicitly.Fixes #651.
The regression test is the part worth the closest review. It keeps the change dependency-free: it parses both mirrored installers to require the qualified command, then performs a real extraction while a same-named function shadows unqualified command resolution.
Testing
Both commands pass locally.
go test ./...was also attempted with the repository-requested Go 1.26.6 toolchain on Windows/386, but unrelated command packages simultaneously reached the suite's 11-minute watchdog. The pull request's macOS Go suite remains the authoritative repository-wide check.Notes
The CLI runtime and non-Windows installers are unchanged. The added Windows job runs only the focused, Pester-free installer regression.
Requirements