From 86ab2ac548b22b0307aec38b843fb0ad822b82ca Mon Sep 17 00:00:00 2001 From: Giuseppe Campanelli Date: Tue, 19 May 2020 18:51:34 -0400 Subject: [PATCH 1/7] Add confirmation prompts and examples for Remove- functions --- GitHubAssignees.ps1 | 8 ++++++-- GitHubComments.ps1 | 8 ++++++-- GitHubLabels.ps1 | 16 ++++++++++++---- GitHubMilestones.ps1 | 8 ++++++-- GitHubProjects.ps1 | 5 ++++- GitHubRepositories.ps1 | 7 ++++++- 6 files changed, 40 insertions(+), 12 deletions(-) diff --git a/GitHubAssignees.ps1 b/GitHubAssignees.ps1 index ad29002d..cb7f8467 100644 --- a/GitHubAssignees.ps1 +++ b/GitHubAssignees.ps1 @@ -323,12 +323,16 @@ function Remove-GithubAssignee .EXAMPLE Remove-GithubAssignee -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Assignee $assignees - Lists the available assignees for issues from the Microsoft\PowerShellForGitHub project. + + .EXAMPLE + Remove-GithubAssignee -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Assignee $assignees -Confirm:$false + Lists the available assignees for issues from the Microsoft\PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified. #> [CmdletBinding( SupportsShouldProcess, - DefaultParameterSetName='Elements')] + DefaultParameterSetName='Elements', + ConfirmImpact="High")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] param( [Parameter(ParameterSetName='Elements')] diff --git a/GitHubComments.ps1 b/GitHubComments.ps1 index f56a2e16..5078faeb 100644 --- a/GitHubComments.ps1 +++ b/GitHubComments.ps1 @@ -448,12 +448,16 @@ function Remove-GitHubComment .EXAMPLE Remove-GitHubComment -OwnerName Microsoft -RepositoryName PowerShellForGitHub -CommentID 1 - Deletes a Github comment from the Microsoft\PowerShellForGitHub project. + + .EXAMPLE + Remove-GitHubComment -OwnerName Microsoft -RepositoryName PowerShellForGitHub -CommentID 1 -Confirm:$false + Deletes a Github comment from the Microsoft\PowerShellForGitHub project without prompting confirmation. #> [CmdletBinding( SupportsShouldProcess, - DefaultParameterSetName='Elements')] + DefaultParameterSetName='Elements', + ConfirmImpact="High")] [Alias('Delete-GitHubComment')] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] param( diff --git a/GitHubLabels.ps1 b/GitHubLabels.ps1 index 47ab1c73..bb0b1a0f 100644 --- a/GitHubLabels.ps1 +++ b/GitHubLabels.ps1 @@ -313,12 +313,16 @@ function Remove-GitHubLabel .EXAMPLE Remove-GitHubLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel - Removes the label called "TestLabel" from the PowerShellForGitHub project. + + .EXAMPLE + Remove-GitHubLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel -Confirm:$false + Removes the label called "TestLabel" from the PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified. #> [CmdletBinding( SupportsShouldProcess, - DefaultParameterSetName='Elements')] + DefaultParameterSetName='Elements', + ConfirmImpact="High")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] [Alias('Delete-GitHubLabel')] param( @@ -858,12 +862,16 @@ function Remove-GitHubIssueLabel .EXAMPLE Remove-GitHubIssueLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel -Issue 1 - Removes the label called "TestLabel" from issue 1 in the PowerShellForGitHub project. + + .EXAMPLE + Remove-GitHubIssueLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel -Issue 1 + Removes the label called "TestLabel" from issue 1 in the PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified. #> [CmdletBinding( SupportsShouldProcess, - DefaultParameterSetName='Elements')] + DefaultParameterSetName='Elements', + ConfirmImpact="High")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] [Alias('Delete-GitHubLabel')] param( diff --git a/GitHubMilestones.ps1 b/GitHubMilestones.ps1 index 05a3055f..1a7727b0 100644 --- a/GitHubMilestones.ps1 +++ b/GitHubMilestones.ps1 @@ -498,12 +498,16 @@ function Remove-GitHubMilestone .EXAMPLE Remove-GitHubMilestone -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Milestone 1 - Deletes a Github milestone from the Microsoft\PowerShellForGitHub project. + + .EXAMPLE + Remove-GitHubMilestone -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Milestone 1 -Confirm:$false + Deletes a Github milestone from the Microsoft\PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified. #> [CmdletBinding( SupportsShouldProcess, - DefaultParameterSetName='Elements')] + DefaultParameterSetName='Elements', + ConfirmImpact="High")] [Alias('Delete-GitHubMilestone')] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] param( diff --git a/GitHubProjects.ps1 b/GitHubProjects.ps1 index 8c60d22f..3fdbc81b 100644 --- a/GitHubProjects.ps1 +++ b/GitHubProjects.ps1 @@ -462,9 +462,12 @@ function Remove-GitHubProject .EXAMPLE Remove-GitHubProject -Project 4387531 - Remove project with ID '4387531'. + .EXAMPLE + Remove-GitHubProject -Project 4387531 -Confirm:$false + Remove project with ID '4387531' without prompting for confirmation. + .EXAMPLE $project = Get-GitHubProject -OwnerName Microsoft -RepositoryName PowerShellForGitHub | Where-Object Name -eq 'TestProject' Remove-GitHubProject -Project $project.id diff --git a/GitHubRepositories.ps1 b/GitHubRepositories.ps1 index 2927edca..58f399d1 100644 --- a/GitHubRepositories.ps1 +++ b/GitHubRepositories.ps1 @@ -217,10 +217,15 @@ function Remove-GitHubRepository .EXAMPLE Remove-GitHubRepository -Uri https://github.com/You/YourRepoToDelete + + .EXAMPLE + Remove-GitHubRepository -Uri https://github.com/You/YourRepoToDelete -Confirm:$false + Remove repository given uri without prompting for confirmation. #> [CmdletBinding( SupportsShouldProcess, - DefaultParameterSetName='Elements')] + DefaultParameterSetName='Elements', + ConfirmImpact="High")] [Alias('Delete-GitHubRepository')] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] param( From 143060d15681d047c5d671023f663ffaecfe3237 Mon Sep 17 00:00:00 2001 From: Giuseppe Campanelli Date: Tue, 19 May 2020 20:21:33 -0400 Subject: [PATCH 2/7] Added missing ShouldProcess checks and updated test cases to not prompt for confirmation Also re-addded needed whitespaces --- GitHubAssignees.ps1 | 29 ++++++++----- GitHubComments.ps1 | 24 +++++----- GitHubLabels.ps1 | 58 +++++++++++++++---------- GitHubMilestones.ps1 | 25 ++++++----- GitHubProjects.ps1 | 2 + GitHubRepositories.ps1 | 23 +++++----- Tests/GitHubAnalytics.tests.ps1 | 16 +++---- Tests/GitHubAssignees.tests.ps1 | 4 +- Tests/GitHubComments.tests.ps1 | 4 +- Tests/GitHubContents.tests.ps1 | 2 +- Tests/GitHubEvents.tests.ps1 | 6 +-- Tests/GitHubLabels.tests.ps1 | 36 +++++++-------- Tests/GitHubMilestones.tests.ps1 | 4 +- Tests/GitHubProjects.tests.ps1 | 2 +- Tests/GitHubRepositories.tests.ps1 | 2 +- Tests/GitHubRepositoryForks.tests.ps1 | 4 +- Tests/GitHubRepositoryTraffic.tests.ps1 | 8 ++-- 17 files changed, 139 insertions(+), 110 deletions(-) diff --git a/GitHubAssignees.ps1 b/GitHubAssignees.ps1 index cb7f8467..c594b2f8 100644 --- a/GitHubAssignees.ps1 +++ b/GitHubAssignees.ps1 @@ -323,10 +323,12 @@ function Remove-GithubAssignee .EXAMPLE Remove-GithubAssignee -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Assignee $assignees + Lists the available assignees for issues from the Microsoft\PowerShellForGitHub project. .EXAMPLE Remove-GithubAssignee -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Assignee $assignees -Confirm:$false + Lists the available assignees for issues from the Microsoft\PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified. #> [CmdletBinding( @@ -374,17 +376,20 @@ function Remove-GithubAssignee 'assignees' = $Assignee } - $params = @{ - 'UriFragment' = "repos/$OwnerName/$RepositoryName/issues/$Issue/assignees" - 'Body' = (ConvertTo-Json -InputObject $hashBody) - 'Method' = 'Delete' - 'Description' = "Removing assignees from issue $Issue for $RepositoryName" - 'AccessToken' = $AccessToken - 'AcceptHeader' = 'application/vnd.github.symmetra-preview+json' - 'TelemetryEventName' = $MyInvocation.MyCommand.Name - 'TelemetryProperties' = $telemetryProperties - 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus) + if ($PSCmdlet.ShouldProcess($Assignee -join ', ', "Remove assignee(s)")) + { + $params = @{ + 'UriFragment' = "repos/$OwnerName/$RepositoryName/issues/$Issue/assignees" + 'Body' = (ConvertTo-Json -InputObject $hashBody) + 'Method' = 'Delete' + 'Description' = "Removing assignees from issue $Issue for $RepositoryName" + 'AccessToken' = $AccessToken + 'AcceptHeader' = 'application/vnd.github.symmetra-preview+json' + 'TelemetryEventName' = $MyInvocation.MyCommand.Name + 'TelemetryProperties' = $telemetryProperties + 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus) + } + + return Invoke-GHRestMethod @params } - - return Invoke-GHRestMethod @params } diff --git a/GitHubComments.ps1 b/GitHubComments.ps1 index 5078faeb..12f548e5 100644 --- a/GitHubComments.ps1 +++ b/GitHubComments.ps1 @@ -452,6 +452,7 @@ function Remove-GitHubComment .EXAMPLE Remove-GitHubComment -OwnerName Microsoft -RepositoryName PowerShellForGitHub -CommentID 1 -Confirm:$false + Deletes a Github comment from the Microsoft\PowerShellForGitHub project without prompting confirmation. #> [CmdletBinding( @@ -492,16 +493,19 @@ function Remove-GitHubComment 'CommentID' = (Get-PiiSafeString -PlainText $CommentID) } - $params = @{ - 'UriFragment' = "repos/$OwnerName/$RepositoryName/issues/comments/$CommentID" - 'Method' = 'Delete' - 'Description' = "Removing comment $CommentID for $RepositoryName" - 'AccessToken' = $AccessToken - 'TelemetryEventName' = $MyInvocation.MyCommand.Name - 'TelemetryProperties' = $telemetryProperties - 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus) - } + if ($PSCmdlet.ShouldProcess($CommentID, "Remove comment")) + { + $params = @{ + 'UriFragment' = "repos/$OwnerName/$RepositoryName/issues/comments/$CommentID" + 'Method' = 'Delete' + 'Description' = "Removing comment $CommentID for $RepositoryName" + 'AccessToken' = $AccessToken + 'TelemetryEventName' = $MyInvocation.MyCommand.Name + 'TelemetryProperties' = $telemetryProperties + 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus) + } - return Invoke-GHRestMethod @params + return Invoke-GHRestMethod @params + } } diff --git a/GitHubLabels.ps1 b/GitHubLabels.ps1 index bb0b1a0f..fead3350 100644 --- a/GitHubLabels.ps1 +++ b/GitHubLabels.ps1 @@ -313,10 +313,12 @@ function Remove-GitHubLabel .EXAMPLE Remove-GitHubLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel + Removes the label called "TestLabel" from the PowerShellForGitHub project. .EXAMPLE Remove-GitHubLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel -Confirm:$false + Removes the label called "TestLabel" from the PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified. #> [CmdletBinding( @@ -358,18 +360,21 @@ function Remove-GitHubLabel 'RepositoryName' = (Get-PiiSafeString -PlainText $RepositoryName) } - $params = @{ - 'UriFragment' = "repos/$OwnerName/$RepositoryName/labels/$Name" - 'Method' = 'Delete' - 'Description' = "Deleting label $Name from $RepositoryName" - 'AcceptHeader' = 'application/vnd.github.symmetra-preview+json' - 'AccessToken' = $AccessToken - 'TelemetryEventName' = $MyInvocation.MyCommand.Name - 'TelemetryProperties' = $telemetryProperties - 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus) - } + if ($PSCmdlet.ShouldProcess($Name, "Remove label")) + { + $params = @{ + 'UriFragment' = "repos/$OwnerName/$RepositoryName/labels/$Name" + 'Method' = 'Delete' + 'Description' = "Deleting label $Name from $RepositoryName" + 'AcceptHeader' = 'application/vnd.github.symmetra-preview+json' + 'AccessToken' = $AccessToken + 'TelemetryEventName' = $MyInvocation.MyCommand.Name + 'TelemetryProperties' = $telemetryProperties + 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus) + } - return Invoke-GHRestMethod @params + return Invoke-GHRestMethod @params + } } function Update-GitHubLabel @@ -615,7 +620,7 @@ function Set-GitHubLabel if ($labelName -notin $labelNames) { # Remove label if it exists but is not in desired label list - $null = Remove-GitHubLabel -Name $labelName @commonParams + $null = Remove-GitHubLabel -Name $labelName @commonParams -Confirm:$false } } } @@ -862,10 +867,12 @@ function Remove-GitHubIssueLabel .EXAMPLE Remove-GitHubIssueLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel -Issue 1 + Removes the label called "TestLabel" from issue 1 in the PowerShellForGitHub project. .EXAMPLE - Remove-GitHubIssueLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel -Issue 1 + Remove-GitHubIssueLabel -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Name TestLabel -Issue 1 -Confirm:$false + Removes the label called "TestLabel" from issue 1 in the PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified. #> [CmdletBinding( @@ -918,18 +925,21 @@ function Remove-GitHubIssueLabel $description = "Deleting all labels from issue $Issue in $RepositoryName" } - $params = @{ - 'UriFragment' = "/repos/$OwnerName/$RepositoryName/issues/$Issue/labels/$Name" - 'Method' = 'Delete' - 'Description' = $description - 'AcceptHeader' = 'application/vnd.github.symmetra-preview+json' - 'AccessToken' = $AccessToken - 'TelemetryEventName' = $MyInvocation.MyCommand.Name - 'TelemetryProperties' = $telemetryProperties - 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus) - } + if ($PSCmdlet.ShouldProcess($Name, "Remove label")) + { + $params = @{ + 'UriFragment' = "/repos/$OwnerName/$RepositoryName/issues/$Issue/labels/$Name" + 'Method' = 'Delete' + 'Description' = $description + 'AcceptHeader' = 'application/vnd.github.symmetra-preview+json' + 'AccessToken' = $AccessToken + 'TelemetryEventName' = $MyInvocation.MyCommand.Name + 'TelemetryProperties' = $telemetryProperties + 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus) + } - return Invoke-GHRestMethod @params + return Invoke-GHRestMethod @params + } } # A set of labels that a project might want to initially populate their repository with diff --git a/GitHubMilestones.ps1 b/GitHubMilestones.ps1 index 1a7727b0..022e427d 100644 --- a/GitHubMilestones.ps1 +++ b/GitHubMilestones.ps1 @@ -498,10 +498,12 @@ function Remove-GitHubMilestone .EXAMPLE Remove-GitHubMilestone -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Milestone 1 + Deletes a Github milestone from the Microsoft\PowerShellForGitHub project. .EXAMPLE Remove-GitHubMilestone -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Milestone 1 -Confirm:$false + Deletes a Github milestone from the Microsoft\PowerShellForGitHub project. Will not prompt for confirmation, as -Confirm:$false was specified. #> [CmdletBinding( @@ -541,15 +543,18 @@ function Remove-GitHubMilestone 'Milestone' = (Get-PiiSafeString -PlainText $Milestone) } - $params = @{ - 'UriFragment' = "repos/$OwnerName/$RepositoryName/milestones/$Milestone" - 'Method' = 'Delete' - 'Description' = "Removing milestone $Milestone for $RepositoryName" - 'AccessToken' = $AccessToken - 'TelemetryEventName' = $MyInvocation.MyCommand.Name - 'TelemetryProperties' = $telemetryProperties - 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus) - } + if ($PSCmdlet.ShouldProcess($Milestone, "Remove milestone")) + { + $params = @{ + 'UriFragment' = "repos/$OwnerName/$RepositoryName/milestones/$Milestone" + 'Method' = 'Delete' + 'Description' = "Removing milestone $Milestone for $RepositoryName" + 'AccessToken' = $AccessToken + 'TelemetryEventName' = $MyInvocation.MyCommand.Name + 'TelemetryProperties' = $telemetryProperties + 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -Name NoStatus -ConfigValueName DefaultNoStatus) + } - return Invoke-GHRestMethod @params + return Invoke-GHRestMethod @params + } } diff --git a/GitHubProjects.ps1 b/GitHubProjects.ps1 index 3fdbc81b..62cd646b 100644 --- a/GitHubProjects.ps1 +++ b/GitHubProjects.ps1 @@ -462,10 +462,12 @@ function Remove-GitHubProject .EXAMPLE Remove-GitHubProject -Project 4387531 + Remove project with ID '4387531'. .EXAMPLE Remove-GitHubProject -Project 4387531 -Confirm:$false + Remove project with ID '4387531' without prompting for confirmation. .EXAMPLE diff --git a/GitHubRepositories.ps1 b/GitHubRepositories.ps1 index 58f399d1..9cea73df 100644 --- a/GitHubRepositories.ps1 +++ b/GitHubRepositories.ps1 @@ -220,6 +220,7 @@ function Remove-GitHubRepository .EXAMPLE Remove-GitHubRepository -Uri https://github.com/You/YourRepoToDelete -Confirm:$false + Remove repository given uri without prompting for confirmation. #> [CmdletBinding( @@ -255,18 +256,20 @@ function Remove-GitHubRepository 'OwnerName' = (Get-PiiSafeString -PlainText $OwnerName) 'RepositoryName' = (Get-PiiSafeString -PlainText $RepositoryName) } + if ($PSCmdlet.ShouldProcess($RepositoryName, "Remove repository")) + { + $params = @{ + 'UriFragment' = "repos/$OwnerName/$RepositoryName" + 'Method' = 'Delete' + 'Description' = "Deleting $RepositoryName" + 'AccessToken' = $AccessToken + 'TelemetryEventName' = $MyInvocation.MyCommand.Name + 'TelemetryProperties' = $telemetryProperties + 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -BoundParameters $PSBoundParameters -Name NoStatus -ConfigValueName DefaultNoStatus) + } - $params = @{ - 'UriFragment' = "repos/$OwnerName/$RepositoryName" - 'Method' = 'Delete' - 'Description' = "Deleting $RepositoryName" - 'AccessToken' = $AccessToken - 'TelemetryEventName' = $MyInvocation.MyCommand.Name - 'TelemetryProperties' = $telemetryProperties - 'NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue -BoundParameters $PSBoundParameters -Name NoStatus -ConfigValueName DefaultNoStatus) + return Invoke-GHRestMethod @params } - - return Invoke-GHRestMethod @params } function Get-GitHubRepository diff --git a/Tests/GitHubAnalytics.tests.ps1 b/Tests/GitHubAnalytics.tests.ps1 index 0fb70198..4f14f14c 100644 --- a/Tests/GitHubAnalytics.tests.ps1 +++ b/Tests/GitHubAnalytics.tests.ps1 @@ -69,7 +69,7 @@ try } } - $null = Remove-GitHubRepository -Uri ($repo.svn_url) + $null = Remove-GitHubRepository -Uri ($repo.svn_url) -Confirm:$false } Describe 'Obtaining repository with biggest number of issues' { @@ -98,8 +98,8 @@ try } } - $null = Remove-GitHubRepository -Uri ($repo1.svn_url) - $null = Remove-GitHubRepository -Uri ($repo2.svn_url) + $null = Remove-GitHubRepository -Uri ($repo1.svn_url) -Confirm:$false + $null = Remove-GitHubRepository -Uri ($repo2.svn_url) -Confirm:$false } @@ -192,7 +192,7 @@ try @($collaborators).Count | Should be 1 } - $null = Remove-GitHubRepository -OwnerName $script:ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $script:ownerName -RepositoryName $repositoryName -Confirm:$false } } @@ -207,7 +207,7 @@ try @($contributors).Count | Should be 1 } - $null = Remove-GitHubRepository -OwnerName $script:ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $script:ownerName -RepositoryName $repositoryName -Confirm:$false } if ($script:accessTokenConfigured) @@ -253,7 +253,7 @@ try (@($current).Count - @($original).Count) | Should be 1 } - $null = Remove-GitHubRepository -Uri $repo.svn_url + $null = Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } Describe 'Getting unique contributors from contributors array' { @@ -271,7 +271,7 @@ try @($uniqueContributors).Count | Should be 1 } - $null = Remove-GitHubRepository -OwnerName $script:ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $script:ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Getting repository name from url' { @@ -308,7 +308,7 @@ try @($branches[0].name) | Should be "master" } - $null = Remove-GitHubRepository -OwnerName $script:ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $script:ownerName -RepositoryName $repositoryName -Confirm:$false } } finally diff --git a/Tests/GitHubAssignees.tests.ps1 b/Tests/GitHubAssignees.tests.ps1 index 9ea07346..ae6dc0be 100644 --- a/Tests/GitHubAssignees.tests.ps1 +++ b/Tests/GitHubAssignees.tests.ps1 @@ -52,7 +52,7 @@ try $issue.assignee.login | Should be $assigneeUserName } - Remove-GithubAssignee -Uri $repo.svn_url -Issue $issue.number -Assignee $assignees + Remove-GithubAssignee -Uri $repo.svn_url -Issue $issue.number -Assignee $assignees -Confirm:$false $issue = Get-GitHubIssue -Uri $repo.svn_url -Issue $issue.number It 'Should have removed the user from issue' { @@ -61,7 +61,7 @@ try } } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } finally { diff --git a/Tests/GitHubComments.tests.ps1 b/Tests/GitHubComments.tests.ps1 index 9bdd5a62..66c9242b 100644 --- a/Tests/GitHubComments.tests.ps1 +++ b/Tests/GitHubComments.tests.ps1 @@ -76,7 +76,7 @@ try } foreach($comment in $existingComments) { - Remove-GitHubComment -Uri $repo.svn_url -CommentID $comment.id + Remove-GitHubComment -Uri $repo.svn_url -CommentID $comment.id -Confirm:$false } $existingComments = @(Get-GitHubComment -Uri $repo.svn_url) @@ -86,7 +86,7 @@ try } } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } finally diff --git a/Tests/GitHubContents.tests.ps1 b/Tests/GitHubContents.tests.ps1 index 554ce61b..199479af 100644 --- a/Tests/GitHubContents.tests.ps1 +++ b/Tests/GitHubContents.tests.ps1 @@ -162,7 +162,7 @@ try } } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } finally diff --git a/Tests/GitHubEvents.tests.ps1 b/Tests/GitHubEvents.tests.ps1 index 4364dcf0..4411d640 100644 --- a/Tests/GitHubEvents.tests.ps1 +++ b/Tests/GitHubEvents.tests.ps1 @@ -37,7 +37,7 @@ try } } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Getting events from an issue' { @@ -63,7 +63,7 @@ try } } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Getting an event directly' { @@ -82,7 +82,7 @@ try } } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } } } diff --git a/Tests/GitHubLabels.tests.ps1 b/Tests/GitHubLabels.tests.ps1 index 9d1158b3..86ecebcb 100644 --- a/Tests/GitHubLabels.tests.ps1 +++ b/Tests/GitHubLabels.tests.ps1 @@ -94,7 +94,7 @@ try } } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Creating new label' { @@ -110,10 +110,10 @@ try } AfterEach { - Remove-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name $labelName + Remove-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name $labelName -Confirm:$false } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Removing label' { @@ -129,14 +129,14 @@ try $($labels).Count | Should be ($defaultLabels.Count + 1) } - Remove-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name $labelName + Remove-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name $labelName -Confirm:$false $labels = Get-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName It 'Should return expected number of labels' { $($labels).Count | Should be $defaultLabels.Count } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Updating label' { @@ -151,7 +151,7 @@ try $label = Get-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name $labelName AfterEach { - Remove-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name $labelName + Remove-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name $labelName -Confirm:$false } It 'Label should have different color' { @@ -166,7 +166,7 @@ try $label = Get-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name $newLabelName AfterEach { - Remove-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name $newLabelName + Remove-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name $newLabelName -Confirm:$false } It 'Label should have different color' { @@ -175,7 +175,7 @@ try } } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Applying set of labels on repository' { @@ -193,7 +193,7 @@ try Update-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name "bug" -NewName "bug" -Color BBBBBB # Remove one of approved labels" - Remove-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name "discussion" + Remove-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name "discussion" -Confirm:$false It 'Should return increased number of labels' { $($labels).Count | Should be ($defaultLabels.Count + 1) @@ -208,7 +208,7 @@ try $bugLabel.color | Should be "fc2929" } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Adding labels to an issue'{ @@ -235,7 +235,7 @@ try } } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Creating a new Issue with labels' { @@ -251,7 +251,7 @@ try $issue.labels.Count | Should be $issueLabels.Count } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Removing labels on an issue'{ @@ -266,9 +266,9 @@ try Add-GitHubIssueLabel -OwnerName $ownerName -RepositoryName $repositoryName -Issue $issue.number -LabelName $labelsToAdd Context 'For removing individual issues'{ - Remove-GitHubIssueLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name "discussion" -Issue $issue.number - Remove-GitHubIssueLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name "question" -Issue $issue.number - Remove-GitHubIssueLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name "bug" -Issue $issue.number + Remove-GitHubIssueLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name "discussion" -Issue $issue.number -Confirm:$false + Remove-GitHubIssueLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name "question" -Issue $issue.number -Confirm:$false + Remove-GitHubIssueLabel -OwnerName $ownerName -RepositoryName $repositoryName -Name "bug" -Issue $issue.number -Confirm:$false $labelIssues = Get-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Issue $issue.number It 'Should have removed three labels from the issue' { @@ -278,14 +278,14 @@ try Context 'For removing all issues'{ Remove-GitHubIssueLabel -OwnerName $ownerName -RepositoryName $repositoryName -Issue $issue.number - $labelIssues = Get-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Issue $issue.number + $labelIssues = Get-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Issue $issue.number -Confirm:$false It 'Should have removed all labels from the issue' { $labelIssues.Count | Should be 0 } } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } Describe 'Replacing labels on an issue'{ @@ -319,7 +319,7 @@ try $updatedIssue.labels.Count | Should be $updatedIssueLabels.Count } - $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName + $null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName -Confirm:$false } } } diff --git a/Tests/GitHubMilestones.tests.ps1 b/Tests/GitHubMilestones.tests.ps1 index 9e943908..604f268c 100644 --- a/Tests/GitHubMilestones.tests.ps1 +++ b/Tests/GitHubMilestones.tests.ps1 @@ -111,7 +111,7 @@ try } foreach($milestone in $existingMilestones) { - Remove-GitHubMilestone -Uri $repo.svn_url -Milestone $milestone.number + Remove-GitHubMilestone -Uri $repo.svn_url -Milestone $milestone.number -Confirm:$false } $existingMilestones = @(Get-GitHubMilestone -Uri $repo.svn_url) @@ -123,7 +123,7 @@ try } } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } finally diff --git a/Tests/GitHubProjects.tests.ps1 b/Tests/GitHubProjects.tests.ps1 index 6674a3e2..878e5d39 100644 --- a/Tests/GitHubProjects.tests.ps1 +++ b/Tests/GitHubProjects.tests.ps1 @@ -319,7 +319,7 @@ try } } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } finally { diff --git a/Tests/GitHubRepositories.tests.ps1 b/Tests/GitHubRepositories.tests.ps1 index cd3c9fd3..9c97fb1f 100644 --- a/Tests/GitHubRepositories.tests.ps1 +++ b/Tests/GitHubRepositories.tests.ps1 @@ -35,7 +35,7 @@ try ## cleanup temp testing repository AfterEach -Scriptblock { ## variables from BeforeEach scriptblock are accessible here, but not variables from It scriptblocks, so need to make URI (instead of being able to use $renamedRepo variable from It scriptblock) - Remove-GitHubRepository -Uri "$($repo.svn_url)$suffixToAddToRepo" -Verbose + Remove-GitHubRepository -Uri "$($repo.svn_url)$suffixToAddToRepo" -Verbose -Confirm:$false } } } diff --git a/Tests/GitHubRepositoryForks.tests.ps1 b/Tests/GitHubRepositoryForks.tests.ps1 index 7c80ab7a..d51f295a 100644 --- a/Tests/GitHubRepositoryForks.tests.ps1 +++ b/Tests/GitHubRepositoryForks.tests.ps1 @@ -27,7 +27,7 @@ try $newForks[0].full_name | Should be "$($script:ownerName)/PowerShellForGitHub" } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } @@ -48,7 +48,7 @@ try $newForks[0].full_name | Should be "$($script:organizationName)/PowerShellForGitHub" } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } } diff --git a/Tests/GitHubRepositoryTraffic.tests.ps1 b/Tests/GitHubRepositoryTraffic.tests.ps1 index 19d76d8e..b684c30a 100644 --- a/Tests/GitHubRepositoryTraffic.tests.ps1 +++ b/Tests/GitHubRepositoryTraffic.tests.ps1 @@ -22,7 +22,7 @@ try @($referrerList).Count | Should be 0 } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } @@ -36,7 +36,7 @@ try @($pathList).Count | Should be 0 } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } @@ -50,7 +50,7 @@ try $viewList.Count | Should be 0 } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } @@ -64,7 +64,7 @@ try $cloneList.Count | Should be 0 } - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } } From 67e7b0e0fae60f8675ccc625a390f0fe75cacca5 Mon Sep 17 00:00:00 2001 From: Giuseppe Campanelli Date: Tue, 19 May 2020 20:22:02 -0400 Subject: [PATCH 3/7] Missed file Added line-space in example --- GitHubComments.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/GitHubComments.ps1 b/GitHubComments.ps1 index 12f548e5..7818bb73 100644 --- a/GitHubComments.ps1 +++ b/GitHubComments.ps1 @@ -448,6 +448,7 @@ function Remove-GitHubComment .EXAMPLE Remove-GitHubComment -OwnerName Microsoft -RepositoryName PowerShellForGitHub -CommentID 1 + Deletes a Github comment from the Microsoft\PowerShellForGitHub project. .EXAMPLE From ad28bf945b981355bb8b68f8998ffc07acc7a50d Mon Sep 17 00:00:00 2001 From: Giuseppe Campanelli Date: Tue, 26 May 2020 18:29:11 -0400 Subject: [PATCH 4/7] Added remaining confirmations for Remove-GitHubRepository --- Tests/GitHubRepositories.tests.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/GitHubRepositories.tests.ps1 b/Tests/GitHubRepositories.tests.ps1 index bdd5cc3c..92920780 100644 --- a/Tests/GitHubRepositories.tests.ps1 +++ b/Tests/GitHubRepositories.tests.ps1 @@ -44,8 +44,8 @@ try } AfterAll -ScriptBlock { - Remove-GitHubRepository -Uri $publicRepo.svn_url - Remove-GitHubRepository -Uri $privateRepo.svn_url + Remove-GitHubRepository -Uri $publicRepo.svn_url -Confirm:$false + Remove-GitHubRepository -Uri $privateRepo.svn_url -Confirm:$false } } @@ -72,7 +72,7 @@ try } AfterAll -ScriptBlock { - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } @@ -109,7 +109,7 @@ try } AfterAll -ScriptBlock { - Remove-GitHubRepository -Uri $repo.svn_url + Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false } } } @@ -134,7 +134,7 @@ try ## cleanup temp testing repository AfterEach -Scriptblock { ## variables from BeforeEach scriptblock are accessible here, but not variables from It scriptblocks, so need to make URI (instead of being able to use $renamedRepo variable from It scriptblock) - Remove-GitHubRepository -Uri "$($repo.svn_url)$suffixToAddToRepo" -Verbose -Confirm:$false + Remove-GitHubRepository -Uri "$($repo.svn_url)$suffixToAddToRepo" -Confirm:$false } } } From 5d0e3dc068fd72c320d060bb1879edb17643c144 Mon Sep 17 00:00:00 2001 From: Giuseppe Campanelli Date: Tue, 26 May 2020 18:29:39 -0400 Subject: [PATCH 5/7] Update GitHubRepositories.ps1 Co-authored-by: Howard Wolosky --- GitHubRepositories.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitHubRepositories.ps1 b/GitHubRepositories.ps1 index 3577c502..dfc70a86 100644 --- a/GitHubRepositories.ps1 +++ b/GitHubRepositories.ps1 @@ -221,7 +221,7 @@ function Remove-GitHubRepository .EXAMPLE Remove-GitHubRepository -Uri https://github.com/You/YourRepoToDelete -Confirm:$false - Remove repository given uri without prompting for confirmation. + Remove repository with the given URI, without prompting for confirmation. #> [CmdletBinding( SupportsShouldProcess, From 88fedc786a8a75898449082ecad7e9c6f67d8c0d Mon Sep 17 00:00:00 2001 From: Giuseppe Campanelli Date: Tue, 26 May 2020 18:35:42 -0400 Subject: [PATCH 6/7] Fix issue in GitHubLabels.tests.ps1 --- Tests/GitHubLabels.tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/GitHubLabels.tests.ps1 b/Tests/GitHubLabels.tests.ps1 index 86ecebcb..832c9add 100644 --- a/Tests/GitHubLabels.tests.ps1 +++ b/Tests/GitHubLabels.tests.ps1 @@ -277,8 +277,8 @@ try } Context 'For removing all issues'{ - Remove-GitHubIssueLabel -OwnerName $ownerName -RepositoryName $repositoryName -Issue $issue.number - $labelIssues = Get-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Issue $issue.number -Confirm:$false + Remove-GitHubIssueLabel -OwnerName $ownerName -RepositoryName $repositoryName -Issue $issue.number -Confirm:$false + $labelIssues = Get-GitHubLabel -OwnerName $ownerName -RepositoryName $repositoryName -Issue $issue.number It 'Should have removed all labels from the issue' { $labelIssues.Count | Should be 0 From 86d2086fe8068d5db068e8fbc528c6a1c0adb3b5 Mon Sep 17 00:00:00 2001 From: Giuseppe Campanelli Date: Thu, 28 May 2020 21:01:03 -0400 Subject: [PATCH 7/7] Remove exception for PSShouldProcess --- GitHubAssignees.ps1 | 1 - GitHubComments.ps1 | 1 - GitHubLabels.ps1 | 2 -- GitHubMilestones.ps1 | 1 - GitHubProjectCards.ps1 | 1 - GitHubProjectColumns.ps1 | 1 - GitHubProjects.ps1 | 1 - GitHubRepositories.ps1 | 1 - 8 files changed, 9 deletions(-) diff --git a/GitHubAssignees.ps1 b/GitHubAssignees.ps1 index 51669147..e9311c71 100644 --- a/GitHubAssignees.ps1 +++ b/GitHubAssignees.ps1 @@ -338,7 +338,6 @@ function Remove-GithubAssignee SupportsShouldProcess, DefaultParameterSetName='Elements', ConfirmImpact="High")] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "", Justification="One or more parameters (like NoStatus) are only referenced by helper methods which get access to it from the stack via Get-Variable -Scope 1.")] param( [Parameter(ParameterSetName='Elements')] diff --git a/GitHubComments.ps1 b/GitHubComments.ps1 index 067fb588..ea66366d 100644 --- a/GitHubComments.ps1 +++ b/GitHubComments.ps1 @@ -463,7 +463,6 @@ function Remove-GitHubComment DefaultParameterSetName='Elements', ConfirmImpact="High")] [Alias('Delete-GitHubComment')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "", Justification="One or more parameters (like NoStatus) are only referenced by helper methods which get access to it from the stack via Get-Variable -Scope 1.")] param( [Parameter(ParameterSetName='Elements')] diff --git a/GitHubLabels.ps1 b/GitHubLabels.ps1 index 0d29dc95..04eb3ed3 100644 --- a/GitHubLabels.ps1 +++ b/GitHubLabels.ps1 @@ -326,7 +326,6 @@ function Remove-GitHubLabel SupportsShouldProcess, DefaultParameterSetName='Elements', ConfirmImpact="High")] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "", Justification="One or more parameters (like NoStatus) are only referenced by helper methods which get access to it from the stack via Get-Variable -Scope 1.")] [Alias('Delete-GitHubLabel')] param( @@ -884,7 +883,6 @@ function Remove-GitHubIssueLabel SupportsShouldProcess, DefaultParameterSetName='Elements', ConfirmImpact="High")] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] [Alias('Delete-GitHubLabel')] param( [Parameter(Mandatory, ParameterSetName='Elements')] diff --git a/GitHubMilestones.ps1 b/GitHubMilestones.ps1 index 2ddf1627..11bf627b 100644 --- a/GitHubMilestones.ps1 +++ b/GitHubMilestones.ps1 @@ -511,7 +511,6 @@ function Remove-GitHubMilestone DefaultParameterSetName='Elements', ConfirmImpact="High")] [Alias('Delete-GitHubMilestone')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "", Justification="One or more parameters (like NoStatus) are only referenced by helper methods which get access to it from the stack via Get-Variable -Scope 1.")] param( [Parameter(Mandatory, ParameterSetName='Elements')] diff --git a/GitHubProjectCards.ps1 b/GitHubProjectCards.ps1 index 86ea7988..5eeb0bff 100644 --- a/GitHubProjectCards.ps1 +++ b/GitHubProjectCards.ps1 @@ -370,7 +370,6 @@ function Remove-GitHubProjectCard SupportsShouldProcess, ConfirmImpact = 'High')] [Alias('Delete-GitHubProjectCard')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification = "Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "", Justification="One or more parameters (like NoStatus) are only referenced by helper methods which get access to it from the stack via Get-Variable -Scope 1.")] param( [Parameter(Mandatory)] diff --git a/GitHubProjectColumns.ps1 b/GitHubProjectColumns.ps1 index c1e84173..aa1b61a8 100644 --- a/GitHubProjectColumns.ps1 +++ b/GitHubProjectColumns.ps1 @@ -266,7 +266,6 @@ function Remove-GitHubProjectColumn SupportsShouldProcess, ConfirmImpact = 'High')] [Alias('Delete-GitHubProjectColumn')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification = "Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "", Justification="One or more parameters (like NoStatus) are only referenced by helper methods which get access to it from the stack via Get-Variable -Scope 1.")] param( [Parameter(Mandatory)] diff --git a/GitHubProjects.ps1 b/GitHubProjects.ps1 index c60a3f81..95060198 100644 --- a/GitHubProjects.ps1 +++ b/GitHubProjects.ps1 @@ -481,7 +481,6 @@ function Remove-GitHubProject SupportsShouldProcess, ConfirmImpact = 'High')] [Alias('Delete-GitHubProject')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification = "Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "", Justification="One or more parameters (like NoStatus) are only referenced by helper methods which get access to it from the stack via Get-Variable -Scope 1.")] param( [Parameter(Mandatory)] diff --git a/GitHubRepositories.ps1 b/GitHubRepositories.ps1 index dfc70a86..b37da6c7 100644 --- a/GitHubRepositories.ps1 +++ b/GitHubRepositories.ps1 @@ -228,7 +228,6 @@ function Remove-GitHubRepository DefaultParameterSetName='Elements', ConfirmImpact="High")] [Alias('Delete-GitHubRepository')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")] param( [Parameter(ParameterSetName='Elements')] [string] $OwnerName,