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

Update Get-GSGroupMember.ps1 IncludeDerivedMembership #382

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions PSGSuite/Public/Groups/Get-GSGroupMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ function Get-GSGroupMember {
.PARAMETER Roles
If specified, returns only the members of the specified role(s)

.PARAMETER includeDerivedMembership
If specified, returns all derived group members

.PARAMETER PageSize
Page size of the result set

Expand Down Expand Up @@ -43,6 +46,9 @@ function Get-GSGroupMember {
[String[]]
$Roles,
[parameter(Mandatory=$false,ParameterSetName = "List")]
[Switch]
$includeDerivedMembership,
[parameter(Mandatory=$false,ParameterSetName = "List")]
[ValidateRange(1,200)]
[Int]
$PageSize = 200,
Expand Down Expand Up @@ -98,6 +104,10 @@ function Get-GSGroupMember {
else {
Write-Verbose "Getting all members of group '$Id'"
}
if ($includeDerivedMembership.IsPresent) {
Write-Verbose "Getting all derived members of group '$Id'"
$request.IncludeDerivedMembership = $true
}
[int]$i = 1
$overLimit = $false
do {
Expand Down