PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Update-PSResource -Confirm confirms too many actions

Open peetrike opened this issue 2 years ago • 3 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest released version
  • [X] 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

peetrike avatar Oct 13 '23 11:10 peetrike

Thanks @peetrike if you respond [A] does it still prompt?

SydneyhSmith avatar Oct 16 '23 18:10 SydneyhSmith

Using Yes to All doesn't ask any more. But when I want to manually select modules, it doesn't allow me. The cmdlet should ask for every module once. And if module is already updated, there is no point to ask once again.

And that "Exit ShouldProcess" shouldn't be asked at all.

peetrike avatar Oct 17 '23 14:10 peetrike

The same problem is with Install-PSResource

peetrike avatar Oct 17 '23 15:10 peetrike