Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove- commands should prompt for confirmation #171

Closed
jpomfret opened this issue May 13, 2020 · 1 comment · Fixed by #174
Closed

Remove- commands should prompt for confirmation #171

jpomfret opened this issue May 13, 2020 · 1 comment · Fixed by #174
Labels
bug This relates to a bug in the existing module. good first issue If you're new to the project (or to OSS in general) and you'd like to contribute, try this one. up for grabs Anyone in the community is welcome to do this work

Comments

@jpomfret
Copy link
Contributor

Functions that remove something should have ConfirmImpact set to High.

I noticed that Remove-GitHubRepository doesn't prompt for confirmation, these are also missing that:

  • Remove-GithubAssignee
  • Remove-GitHubComment
  • Remove-GitHubIssueLabel
  • Remove-GitHubLabel
  • Remove-GitHubMilestone
  • Remove-GitHubRepository
@HowardWolosky HowardWolosky added bug This relates to a bug in the existing module. good first issue If you're new to the project (or to OSS in general) and you'd like to contribute, try this one. up for grabs Anyone in the community is welcome to do this work labels May 13, 2020
@HowardWolosky
Copy link
Member

Indeed. And similar to the cl that introduced this concept, there should also be an example added that shows how to avoid the prompting as well.

.EXAMPLE
Get-GitHubRepository -Uri https://github.com/octocat/hello-world | Rename-GitHubRepository -NewName hello-again-world -Confirm:$false
Get the repository at https://github.com/octocat/hello-world and then rename it https://github.com/octocat/hello-again-world. Will not prompt for confirmation, as -Confirm:$false was specified.

HowardWolosky pushed a commit that referenced this issue Jun 1, 2020
…nctions (#174)

Updates all Remove-* functions to set `ConfirmImpact='High'`, wraps the execution in `$PSCmdlet.ShouldProcess()`, and adds examples which show how to call the functions with `-Confirm:$false` to avoid the confirmation prompt.

## Breaking Change
This will be considered a breaking change for anyone using this module in an automated, scripted basis and calling any Remove-* methods.  They will need to add `-Confirm:$false` to those API calls, similar to what was done for the unit tests.

Fixes #171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This relates to a bug in the existing module. good first issue If you're new to the project (or to OSS in general) and you'd like to contribute, try this one. up for grabs Anyone in the community is welcome to do this work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants