Skip to content

Commit 19b0684

Browse files
authored
Merge pull request #298 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents abfabc6 + ce7781d commit 19b0684

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Groups/Invoke-AddGroupTemplate.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@ function Invoke-AddGroupTemplate {
1616
$GUID = $Request.Body.GUID ?? (New-Guid).GUID
1717
try {
1818
if (!$Request.Body.displayname) { throw 'You must enter a displayname' }
19-
19+
$groupType = switch -wildcard ($Request.Body.groupType) {
20+
'*dynamic*' { 'dynamic' }
21+
'*azurerole*' { 'azurerole' }
22+
'*unified*' { 'm365' }
23+
'*Microsoft*' { 'm365' }
24+
'*generic*' { 'generic' }
25+
'*mail*' { 'mailenabledsecurity' }
26+
'*Distribution*' { 'distribution' }
27+
default { $Request.Body.groupType }
28+
}
2029
$object = [PSCustomObject]@{
2130
displayName = $Request.Body.displayName
2231
description = $Request.Body.description
23-
groupType = $Request.Body.groupType
32+
groupType = $groupType
2433
membershipRules = $Request.Body.membershipRules
2534
allowExternal = $Request.Body.allowExternal
2635
username = $Request.Body.username

0 commit comments

Comments
 (0)