You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: GitHubAssignees.ps1
+17-2Lines changed: 17 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -314,6 +314,9 @@ function Remove-GithubAssignee
314
314
.PARAMETERAssignee
315
315
Usernames of assignees to remove from an issue. NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise.
316
316
317
+
.PARAMETERForce
318
+
If this switch is specified, you will not be prompted for confirmation of command execution.
319
+
317
320
.PARAMETERAccessToken
318
321
If provided, this will be used as the AccessToken for authentication with the
319
322
REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.
@@ -327,12 +330,17 @@ function Remove-GithubAssignee
327
330
.EXAMPLE
328
331
Remove-GithubAssignee -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Assignee $assignees
329
332
330
-
Lists the available assignees for issues from the Microsoft\PowerShellForGitHub project.
333
+
Removes the available assignees for issues from the Microsoft\PowerShellForGitHub project.
331
334
332
335
.EXAMPLE
333
336
Remove-GithubAssignee -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Assignee $assignees -Confirm:$false
334
337
335
-
Lists the available assignees for issues from the Microsoft\PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified.
338
+
Removes the available assignees for issues from the Microsoft\PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified.
339
+
340
+
.EXAMPLE
341
+
Remove-GithubAssignee -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Assignee $assignees -Force
342
+
343
+
Removes the available assignees for issues from the Microsoft\PowerShellForGitHub project. Will not prompt for confirmation, as -Force was specified.
336
344
#>
337
345
[CmdletBinding(
338
346
SupportsShouldProcess,
@@ -357,6 +365,8 @@ function Remove-GithubAssignee
357
365
[Parameter(Mandatory)]
358
366
[string[]] $Assignee,
359
367
368
+
[switch] $Force,
369
+
360
370
[string] $AccessToken,
361
371
362
372
[switch] $NoStatus
@@ -379,6 +389,11 @@ function Remove-GithubAssignee
379
389
'assignees'=$Assignee
380
390
}
381
391
392
+
if ($Force-and (-not$Confirm))
393
+
{
394
+
$ConfirmPreference='None'
395
+
}
396
+
382
397
if ($PSCmdlet.ShouldProcess($Assignee-join', ',"Remove assignee(s)"))
if ($PSCmdlet.ShouldProcess($Name,"Remove label"))
365
380
{
366
381
$params=@{
@@ -859,6 +874,9 @@ function Remove-GitHubIssueLabel
859
874
Name of the label to be deleted. If not provided, will delete all labels on the issue.
860
875
Emoji and codes are supported. For more information, see here: https://www.webpagefx.com/tools/emoji-cheat-sheet/
861
876
877
+
.PARAMETERForce
878
+
If this switch is specified, you will not be prompted for confirmation of command execution.
879
+
862
880
.PARAMETERAccessToken
863
881
If provided, this will be used as the AccessToken for authentication with the
864
882
REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.
@@ -878,6 +896,11 @@ function Remove-GitHubIssueLabel
878
896
Remove-GitHubIssueLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel -Issue 1 -Confirm:$false
879
897
880
898
Removes the label called "TestLabel" from issue 1 in the PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified.
899
+
900
+
.EXAMPLE
901
+
Remove-GitHubIssueLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel -Issue 1 -Force
902
+
903
+
Removes the label called "TestLabel" from issue 1 in the PowerShellForGitHub project. Will not prompt for confirmation, as -Force was specified.
881
904
#>
882
905
[CmdletBinding(
883
906
SupportsShouldProcess,
@@ -901,6 +924,8 @@ function Remove-GitHubIssueLabel
901
924
[Alias('LabelName')]
902
925
[string] $Name,
903
926
927
+
[switch] $Force,
928
+
904
929
[string] $AccessToken,
905
930
906
931
[switch] $NoStatus
@@ -928,6 +953,11 @@ function Remove-GitHubIssueLabel
928
953
$description="Deleting all labels from issue $Issue in $RepositoryName"
929
954
}
930
955
956
+
if ($Force-and (-not$Confirm))
957
+
{
958
+
$ConfirmPreference='None'
959
+
}
960
+
931
961
if ($PSCmdlet.ShouldProcess($Name,"Remove label"))
0 commit comments