PSResourceGet
PSResourceGet copied to clipboard
Update-PSResource -Confirm confirms too many actions
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
Thanks @peetrike if you respond [A] does it still prompt?
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.
The same problem is with Install-PSResource