feat(roles): export built-in Intune roles; fix ASCII header failure

- Drop the ExpiresOn request header. Under an en-US culture its date
  contains U+202F before AM/PM, so every Graph call failed with
  "Request headers must contain only ASCII characters". Nothing reads it.
- Export all role definitions with their assignments, including built-in
  roles (was custom only via isBuiltIn eq false).
- On import, skip creating built-in roles. When Import assignments is on,
  recreate their assignments against the exported role id (built-in ids
  are identical across tenants). Custom-role behaviour is unchanged.
This commit is contained in:
2026-11-24 11:34:52 +01:00
parent 60a655e6d4
commit 37ac448d94
4 changed files with 35 additions and 6 deletions
-1
View File
@@ -431,7 +431,6 @@ function Invoke-GraphRequest
$Headers = @{
'Content-Type' = 'application/json; charset=utf-8'
'Authorization' = "Bearer " + $global:MSALToken.AccessToken
'ExpiresOn' = $global:MSALToken.ExpiresOn
'x-ms-client-request-id' = $requestId
}
}