PowerShell / PowerShell/PSResourceGet

Update-PSResource -Confirm confirms too many actions

Open
#1,444 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Update Needs-Attention :wave:
Dominant language
C#
Stars
576
Forks
114
Avg merge
1d 2h
Merged PRs (30d)
7

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.
Steps to reproduce

when using Update-PSResource with -Confirm parameter, the cmdlet confirms also dependent module updates, even if these were updated just with previous item. It also asks for confirmation for "Exit ShouldProcess".

Expected behavior
PS > Update-PSResource -Name Az.* -Confirm

Confirm
Are you sure you want to perform this action?
Performing the operation "Update-PSResource" on target "Package to install: 'Az.Accounts', version: '2.13.1'".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

Confirm
Are you sure you want to perform this action?
Performing the operation "Update-PSResource" on target "Package to install: 'Az.Resources', version: '6.11.1'".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
Actual behavior
PS > Update-PSResource -Name Az.* -Confirm

Confirm
Are you sure you want to perform this action?
Performing the operation "Update-PSResource" on target "Package to install: 'Az.Accounts', version: '2.13.1'".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

Confirm
Are you sure you want to perform this action?
Performing the operation "Update-PSResource" on target "Exit ShouldProcess".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

Confirm
Are you sure you want to perform this action?
Performing the operation "Update-PSResource" on target "Package to install: 'Az.Resources', version: '6.11.1'".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

Confirm
Are you sure you want to perform this action?
Performing the operation "Update-PSResource" on target "Package to install: 'Az.Accounts', version: '2.13.1'".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

Confirm
Are you sure you want to perform this action?
Performing the operation "Update-PSResource" on target "Exit ShouldProcess".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
Error details

No response

Environment data
PSResourceGet v1.0.0
PowerShell v7.3.8 / 5.1
Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Update-PSResource cmdlet entry point and reproduce the -Confirm behavior described for Az.* resources on the reported PowerShell and PSResourceGet versions. Trace how dependent updates and the "Exit ShouldProcess" target reach confirmation; done means each intended package action is confirmed once without extra prompts.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.