mirror of
https://github.com/Micke-K/IntuneManagement.git
synced 2026-11-27 09:22:26 +01:00
Development snapshot 2026-10-25 (4.0.0-beta1 + fixes)
This commit is contained in:
@@ -287,13 +287,19 @@ class IntunePolicyTypeBase
|
||||
}
|
||||
}
|
||||
|
||||
# ToDo: Add PageSize Setting
|
||||
# "All" is the one non-numeric list value and means no $top
|
||||
# (Test-GraphPageSizeAll). It used to fall through the cast into 20 (#384).
|
||||
$pageSizeStr = Get-SettingValue "GraphPageSize" $this._TopItems
|
||||
try {
|
||||
$pageSize = [uint32]$pageSizeStr
|
||||
if(Test-GraphPageSizeAll) {
|
||||
$pageSize = 0
|
||||
}
|
||||
catch {
|
||||
$pageSize = 20
|
||||
else {
|
||||
try {
|
||||
$pageSize = [uint32]$pageSizeStr
|
||||
}
|
||||
catch {
|
||||
$pageSize = 20
|
||||
}
|
||||
}
|
||||
|
||||
if($this.HasPageSizeSupport -eq $false)
|
||||
@@ -1121,6 +1127,7 @@ class IntunePolicyBase
|
||||
$clonedObject = $this.Clone()
|
||||
|
||||
Remove-GraphPropertiesForImport $clonedObject $clonedObject.JsonObject
|
||||
Remove-GraphAssignmentsFromBody $clonedObject.JsonObject
|
||||
|
||||
$params = @{}
|
||||
$strAPI = (?? $clonedObject.PolicyType.APIPOST $clonedObject.PolicyType.API)
|
||||
@@ -1266,6 +1273,7 @@ class IntunePolicyBase
|
||||
}
|
||||
|
||||
Remove-GraphPropertiesForImport $updateObject $updateObject.JsonObject
|
||||
Remove-GraphAssignmentsFromBody $updateObject.JsonObject
|
||||
# isAssigned is a computed status flag many endpoints refuse to accept
|
||||
# back on PATCH - the original project stripped it on every update.
|
||||
Remove-Property $updateObject.JsonObject "isAssigned"
|
||||
@@ -1359,7 +1367,10 @@ class IntunePolicyBase
|
||||
if($null -eq $sourceObj) { $sourceObj = $this }
|
||||
$newObj.PolicyType.PostImportCommand($newObj, $sourceObj)
|
||||
|
||||
Import-GraphObjectAssignment $newObj $this
|
||||
# Assignments come from the ORIGINAL too: the create body (this clone)
|
||||
# has them stripped (Remove-GraphAssignmentsFromBody, #441). UpdateObject
|
||||
# already passes the original.
|
||||
Import-GraphObjectAssignment $newObj $sourceObj
|
||||
}
|
||||
return $newObj
|
||||
}
|
||||
|
||||
@@ -134,7 +134,10 @@ class FiltersType : IntunePolicyTypeBase
|
||||
$this._ImportOrder = 15
|
||||
$this._ExpandAssignmentsList = $false
|
||||
$this._SupportsAssignments = $false
|
||||
$this._PropertiesToRemoveForUpdate = @('platform')
|
||||
# platform cannot be changed; evaluationMode (Graph beta, Oct 2026) is
|
||||
# accepted on create but any PATCH carrying it fails with a generic 400
|
||||
# (measured live 2026-10-17).
|
||||
$this._PropertiesToRemoveForUpdate = @('platform', 'evaluationMode')
|
||||
$this._PropertiesToRemove = @("payloads")
|
||||
$this._ScopeTagProperty = "roleScopeTags"
|
||||
$this._ObjectClass = "FilterObject"
|
||||
|
||||
@@ -128,10 +128,11 @@ class FeatureUpdateType : IntunePolicyTypeBase
|
||||
}
|
||||
}
|
||||
|
||||
[Hashtable]PreImportAssignmentsCommand([PSCustomObject]$PolicyObject, [PSCustomObject]$SourceObject)
|
||||
{
|
||||
return (@{ "API" = "$($this.API)/$($PolicyObject.Id)/microsoft.graph.managedDeviceMobileAppConfiguration/assign" })
|
||||
}
|
||||
# No PreImportAssignmentsCommand: the default {id}/assign is the right action.
|
||||
# It used to post to {id}/microsoft.graph.managedDeviceMobileAppConfiguration/assign,
|
||||
# a cast copied from app configuration that Graph rejects with 400, so
|
||||
# imported feature update profiles never got their assignments (measured
|
||||
# live 2026-10-17).
|
||||
}
|
||||
|
||||
Class FeatureUpdateObject : IntunePolicyBase
|
||||
|
||||
Reference in New Issue
Block a user