Skip to content

Commit

Permalink
UserGroup: Fix when no members
Browse files Browse the repository at this point in the history
  • Loading branch information
alagoutte committed Sep 6, 2024
1 parent 3d17b66 commit 3e19048
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PowerFGT/Public/cmdb/user/group.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,10 @@ function Remove-FGTUserGroupMember {
$members = $members | Where-Object { $_.name -ne $remove_member }
}

#check if there is always a member... (it is not possible don't have member on User Group)
#if ( $members.count -eq 0 ) {
# Throw "You can't remove all members. Use Remove-FGTUserGroup to remove User Group"
#}
#check if there is always a member... (and force array)
if ( $members.count -eq 0 ) {
$members = @()
}

#if there is only One member force to be an array
if ( $members.count -eq 1 ) {
Expand Down

0 comments on commit 3e19048

Please sign in to comment.