Repository navigation
Respect -WhatIf in PowerShell package commands - #6588
Open
Slai.life (huong8373tt-beep) wants to merge 3 commits into
Open
Slai.life (huong8373tt-beep) wants to merge 3 commits into
Slai.life (huong8373tt-beep) wants to merge 3 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Member
|
This is an important step, but I suspect that "ShouldProcess" support could use a lot of improvement throughout. I would be willing to take this by itself though. |
Slai.life (huong8373tt-beep)
marked this pull request as ready for review
October 21, 2026 19:14
JohnMcPMS
previously approved these changes
Oct 22, 2026
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
Author
|
I checked the approved-head CI failures. The changed PowerShell client Pester set completed with 70 passed / 0 failed. The 53 failures come from |
Slai.life (huong8373tt-beep)
force-pushed
the
fix/powershell-whatif
branch
from
October 25, 2026 01:54
fef0e80 to
248b445
Compare
This comment has been minimized.
This comment has been minimized.
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.
📖 Description
Fixes #4622.
Package commands run their work on an MTA thread. The existing
PowerShellCmdlet.ShouldProcessimplementation returnedtruefrom that thread instead of evaluating PowerShell'sPSCmdlet.ShouldProcess, so-WhatIfcould permit real package operations.Dispatch the decision through the existing PowerShell-thread bridge and return the actual
ShouldProcessresult. Add regression coverage for install, update, uninstall, MSIX repair, and export. Add a release note.🔗 References
Fixes #4622
🔍 Validation
Microsoft.WinGet.Client.Enginefrom3d9083c062c1e7a7086e05becb414d4e005e4ab6and ran an isolated A/B control against the same local source and test package.Install-WinGetPackage -WhatIfreturned a result and created one ARP entry.PackageFullNameremained unchanged.git diff --checkandgit show --checkpassed.✅ Checklist
🤖 AI Assistance
Slai Agent Runtime assisted with analysis, reproduction, implementation, and test execution. The account owner reviewed the reproduction and proposed fix, authorized this contribution, and is responsible for this submission.
📋 Issue Type
Microsoft Reviewers: Open in CodeFlow