File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Endpoint/MEM Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ function Invoke-ExecAssignPolicy {
2121 $GroupIdsRaw = $Request.Body.GroupIds
2222 $GroupNamesRaw = $Request.Body.GroupNames
2323 $AssignmentMode = $Request.Body.assignmentMode
24+ $AssignmentFilterName = $Request.Body.AssignmentFilterName
25+ $AssignmentFilterType = $Request.Body.AssignmentFilterType
2426
2527 # Standardize GroupIds input (can be array or comma-separated string)
2628 function Get-StandardizedList {
@@ -74,6 +76,14 @@ function Invoke-ExecAssignPolicy {
7476 $params.ExcludeGroup = $ExcludeGroup
7577 }
7678
79+ if (-not [string ]::IsNullOrWhiteSpace($AssignmentFilterName )) {
80+ $params.AssignmentFilterName = $AssignmentFilterName
81+ }
82+
83+ if (-not [string ]::IsNullOrWhiteSpace($AssignmentFilterType )) {
84+ $params.AssignmentFilterType = $AssignmentFilterType
85+ }
86+
7787 Set-CIPPAssignedPolicy @params
7888 $StatusCode = [HttpStatusCode ]::OK
7989 } else {
Original file line number Diff line number Diff line change @@ -11,15 +11,14 @@ function Invoke-ListAssignmentFilters {
1111 $APIName = $Request.Params.CIPPEndpoint
1212 $Headers = $Request.Headers
1313
14- Write-LogMessage - headers $Request.Headers - API $APINAME - message ' Accessed this API' - Sev Debug
15-
1614 # Get the tenant filter
17- $TenantFilter = $Request.Query.TenantFilter
15+ $TenantFilter = $Request.Query.tenantFilter
16+ $FilterId = $Request.Query.filterId
1817
1918 try {
20- if ($Request .Query.filterId ) {
19+ if ($FilterId ) {
2120 # Get specific filter
22- $AssignmentFilters = New-GraphGetRequest - uri " https://graph.microsoft.com/beta/deviceManagement/assignmentFilters/$ ( $Request .Query.filterId ) " - tenantid $TenantFilter
21+ $AssignmentFilters = New-GraphGetRequest - uri " https://graph.microsoft.com/beta/deviceManagement/assignmentFilters/$ ( $FilterId ) " - tenantid $TenantFilter
2322 } else {
2423 # Get all filters
2524 $AssignmentFilters = New-GraphGetRequest - uri ' https://graph.microsoft.com/beta/deviceManagement/assignmentFilters' - tenantid $TenantFilter
@@ -28,12 +27,11 @@ function Invoke-ListAssignmentFilters {
2827 $StatusCode = [HttpStatusCode ]::OK
2928 } catch {
3029 $ErrorMessage = Get-CippException - Exception $_
31- Write-LogMessage - headers $Request . Headers - API $APINAME - message " Failed to retrieve assignment filters: $ ( $ErrorMessage.NormalizedError ) " - Sev Error - LogData $ErrorMessage
30+ Write-LogMessage - headers $Headers - API $APIName - message " Failed to retrieve assignment filters: $ ( $ErrorMessage.NormalizedError ) " - Sev Error - LogData $ErrorMessage
3231 $AssignmentFilters = @ ()
3332 $StatusCode = [HttpStatusCode ]::InternalServerError
3433 }
3534
36- # Associate values to output bindings by calling 'Push-OutputBinding'.
3735 return ([HttpResponseContext ]@ {
3836 StatusCode = $StatusCode
3937 Body = @ ($AssignmentFilters )
You can’t perform that action at this time.
0 commit comments