File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Conditional Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,24 @@ function Invoke-AddCAPolicy {
1111 $APIName = $Request.Params.CIPPEndpoint
1212 $Headers = $Request.Headers
1313
14-
1514 $Tenants = $Request.body.tenantFilter.value
1615 if (' AllTenants' -in $Tenants ) { $Tenants = (Get-Tenants ).defaultDomainName }
1716
1817 $results = foreach ($Tenant in $tenants ) {
1918 try {
20- $CAPolicy = New-CIPPCAPolicy - replacePattern $Request.Body.replacename - Overwrite $request.Body.overwrite - TenantFilter $Tenant - state $Request.Body.NewState - DisableSD $Request.Body.DisableSD - RawJSON $Request.Body.RawJSON - APIName $APIName - Headers $Headers
19+ $NewCAPolicy = @ {
20+ replacePattern = $Request.Body.replacename
21+ Overwrite = $Request.Body.overwrite
22+ TenantFilter = $Tenant
23+ state = $Request.Body.NewState
24+ DisableSD = $Request.Body.DisableSD
25+ CreateGroups = $Request.Body.CreateGroups
26+ RawJSON = $Request.Body.RawJSON
27+ APIName = $APIName
28+ Headers = $Headers
29+ }
30+ $CAPolicy = New-CIPPCAPolicy @NewCAPolicy
31+
2132 " $CAPolicy "
2233 } catch {
2334 " $ ( $_.Exception.Message ) "
You can’t perform that action at this time.
0 commit comments