@@ -388,9 +388,6 @@ function New-GitHubTeam
388
388
389
389
You can also pipe in a list of GitHub users that were returned from a previous command.
390
390
#>
391
- [Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSShouldProcess' , ' ' ,
392
- Justification = ' Methods called within here make use of PSShouldProcess, and the switch
393
- is passed on to them inherently.' )]
394
391
[Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSReviewUnusedParameter' , ' ' ,
395
392
Justification = ' One or more parameters (like NoStatus) are only referenced by helper
396
393
methods which get access to it from the stack via Get-Variable -Scope 1.' )]
@@ -498,6 +495,11 @@ function New-GitHubTeam
498
495
$hashBody [' parent_team_id' ] = $team.id
499
496
}
500
497
498
+ if (-not $PSCmdlet.ShouldProcess ($TeamName , ' Create GitHub Team' ))
499
+ {
500
+ return
501
+ }
502
+
501
503
$params = @ {
502
504
UriFragment = $uriFragment
503
505
Body = (ConvertTo-Json - InputObject $hashBody )
@@ -568,9 +570,6 @@ filter Set-GitHubTeam
568
570
569
571
You can also pipe in a GitHub team that was returned from a previous command.
570
572
#>
571
- [Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSShouldProcess' , ' ' ,
572
- Justification = ' Methods called within here make use of PSShouldProcess, and the switch
573
- is passed on to them inherently.' )]
574
573
[Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSReviewUnusedParameter' , ' ' ,
575
574
Justification = ' One or more parameters (like NoStatus) are only referenced by helper
576
575
methods which get access to it from the stack via Get-Variable -Scope 1.' )]
@@ -647,6 +646,11 @@ filter Set-GitHubTeam
647
646
$hashBody [' parent_team_id' ] = $parentTeam.id
648
647
}
649
648
649
+ if (-not $PSCmdlet.ShouldProcess ($TeamName , ' Set GitHub Team' ))
650
+ {
651
+ return
652
+ }
653
+
650
654
$params = @ {
651
655
UriFragment = $uriFragment
652
656
Body = (ConvertTo-Json - InputObject $hashBody )
@@ -715,9 +719,6 @@ filter Remove-GitHubTeam
715
719
716
720
You can also pipe in a GitHub team that was returned from a previous command.
717
721
#>
718
- [Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSShouldProcess' , ' ' ,
719
- Justification = ' Methods called within here make use of PSShouldProcess, and the switch
720
- is passed on to them inherently.' )]
721
722
[Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSReviewUnusedParameter' , ' ' ,
722
723
Justification = ' One or more parameters (like NoStatus) are only referenced by helper
723
724
methods which get access to it from the stack via Get-Variable -Scope 1.' )]
@@ -781,23 +782,25 @@ filter Remove-GitHubTeam
781
782
$ConfirmPreference = ' None'
782
783
}
783
784
784
- if ($PSCmdlet.ShouldProcess ($TeamName , " Remove Team" ))
785
+ if (-not $PSCmdlet.ShouldProcess ($TeamName , ' Remove Github Team' ))
785
786
{
786
- Write-InvocationLog
787
+ return
788
+ }
787
789
788
- $params = @ {
789
- UriFragment = $uriFragment
790
- Method = ' Delete'
791
- Description = " Deleting $TeamName "
792
- AccessToken = $AccessToken
793
- TelemetryEventName = $MyInvocation.MyCommand.Name
794
- TelemetryProperties = $telemetryProperties
795
- NoStatus = (Resolve-ParameterWithDefaultConfigurationValue `
796
- - Name NoStatus - ConfigValueName DefaultNoStatus)
797
- }
790
+ Write-InvocationLog
798
791
799
- Invoke-GHRestMethod @params | Out-Null
792
+ $params = @ {
793
+ UriFragment = $uriFragment
794
+ Method = ' Delete'
795
+ Description = " Deleting $TeamName "
796
+ AccessToken = $AccessToken
797
+ TelemetryEventName = $MyInvocation.MyCommand.Name
798
+ TelemetryProperties = $telemetryProperties
799
+ NoStatus = (Resolve-ParameterWithDefaultConfigurationValue `
800
+ - Name NoStatus - ConfigValueName DefaultNoStatus)
800
801
}
802
+
803
+ Invoke-GHRestMethod @params | Out-Null
801
804
}
802
805
803
806
filter Add-GitHubTeamAdditionalProperties
0 commit comments