Skip to content

Commit 498d03f

Browse files
committed
fix: duplicate group ID retrieval in Invoke-ExecAddGDAPRole function
limit to one per role
1 parent 94a291c commit 498d03f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecAddGDAPRole.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ function Invoke-ExecAddGDAPRole {
101101
if ($GroupName -in $ExistingGroups.displayName) {
102102
@{
103103
PartitionKey = 'Roles'
104-
RowKey = ($ExistingGroups | Where-Object -Property displayName -EQ $GroupName).id
104+
RowKey = ($ExistingGroups | Where-Object -Property displayName -EQ $GroupName | Select-Object -First 1).id
105105
RoleName = $RoleName
106106
GroupName = $GroupName
107-
GroupId = ($ExistingGroups | Where-Object -Property displayName -EQ $GroupName).id
107+
GroupId = ($ExistingGroups | Where-Object -Property displayName -EQ $GroupName | Select-Object -First 1).id
108108
roleDefinitionId = $Value
109109
}
110110
$Results.Add("$GroupName already exists")

0 commit comments

Comments
 (0)