@@ -394,9 +394,6 @@ function New-GitHubTeam
394
394
395
395
You can also pipe in a list of GitHub users that were returned from a previous command.
396
396
#>
397
- [Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSShouldProcess' , ' ' ,
398
- Justification = ' Methods called within here make use of PSShouldProcess, and the switch
399
- is passed on to them inherently.' )]
400
397
[Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSReviewUnusedParameter' , ' ' ,
401
398
Justification = ' One or more parameters (like NoStatus) are only referenced by helper
402
399
methods which get access to it from the stack via Get-Variable -Scope 1.' )]
@@ -504,6 +501,11 @@ function New-GitHubTeam
504
501
$hashBody [' parent_team_id' ] = $team.id
505
502
}
506
503
504
+ if (-not $PSCmdlet.ShouldProcess ($TeamName , ' Create GitHub Team' ))
505
+ {
506
+ return
507
+ }
508
+
507
509
$params = @ {
508
510
UriFragment = $uriFragment
509
511
Body = (ConvertTo-Json - InputObject $hashBody )
@@ -574,9 +576,6 @@ filter Set-GitHubTeam
574
576
575
577
You can also pipe in a GitHub team that was returned from a previous command.
576
578
#>
577
- [Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSShouldProcess' , ' ' ,
578
- Justification = ' Methods called within here make use of PSShouldProcess, and the switch
579
- is passed on to them inherently.' )]
580
579
[Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSReviewUnusedParameter' , ' ' ,
581
580
Justification = ' One or more parameters (like NoStatus) are only referenced by helper
582
581
methods which get access to it from the stack via Get-Variable -Scope 1.' )]
@@ -653,6 +652,11 @@ filter Set-GitHubTeam
653
652
$hashBody [' parent_team_id' ] = $parentTeam.id
654
653
}
655
654
655
+ if (-not $PSCmdlet.ShouldProcess ($TeamName , ' Set GitHub Team' ))
656
+ {
657
+ return
658
+ }
659
+
656
660
$params = @ {
657
661
UriFragment = $uriFragment
658
662
Body = (ConvertTo-Json - InputObject $hashBody )
@@ -721,9 +725,6 @@ filter Remove-GitHubTeam
721
725
722
726
You can also pipe in a GitHub team that was returned from a previous command.
723
727
#>
724
- [Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSShouldProcess' , ' ' ,
725
- Justification = ' Methods called within here make use of PSShouldProcess, and the switch
726
- is passed on to them inherently.' )]
727
728
[Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSReviewUnusedParameter' , ' ' ,
728
729
Justification = ' One or more parameters (like NoStatus) are only referenced by helper
729
730
methods which get access to it from the stack via Get-Variable -Scope 1.' )]
@@ -787,23 +788,25 @@ filter Remove-GitHubTeam
787
788
$ConfirmPreference = ' None'
788
789
}
789
790
790
- if ($PSCmdlet.ShouldProcess ($TeamName , " Remove Team" ))
791
+ if (-not $PSCmdlet.ShouldProcess ($TeamName , ' Remove Github Team' ))
791
792
{
792
- Write-InvocationLog
793
+ return
794
+ }
793
795
794
- $params = @ {
795
- UriFragment = $uriFragment
796
- Method = ' Delete'
797
- Description = " Deleting $TeamName "
798
- AccessToken = $AccessToken
799
- TelemetryEventName = $MyInvocation.MyCommand.Name
800
- TelemetryProperties = $telemetryProperties
801
- NoStatus = (Resolve-ParameterWithDefaultConfigurationValue `
802
- - Name NoStatus - ConfigValueName DefaultNoStatus)
803
- }
796
+ Write-InvocationLog
804
797
805
- Invoke-GHRestMethod @params | Out-Null
798
+ $params = @ {
799
+ UriFragment = $uriFragment
800
+ Method = ' Delete'
801
+ Description = " Deleting $TeamName "
802
+ AccessToken = $AccessToken
803
+ TelemetryEventName = $MyInvocation.MyCommand.Name
804
+ TelemetryProperties = $telemetryProperties
805
+ NoStatus = (Resolve-ParameterWithDefaultConfigurationValue `
806
+ - Name NoStatus - ConfigValueName DefaultNoStatus)
806
807
}
808
+
809
+ Invoke-GHRestMethod @params | Out-Null
807
810
}
808
811
809
812
filter Add-GitHubTeamAdditionalProperties
0 commit comments