diff --git a/src/PolicyIO.ps1 b/src/PolicyIO.ps1 index 4e8723b..03623bb 100644 --- a/src/PolicyIO.ps1 +++ b/src/PolicyIO.ps1 @@ -598,6 +598,7 @@ function Import-GraphAdministrativeTemplate { $presVals = @() $typeCounter = @{} $presFailed = $false + $presDiag = '' foreach ($pv in @(Get-PolicyProp $dv 'presentationValues')) { if (-not $pv) { continue } $pres = Get-PolicyProp $pv 'presentation' @@ -605,8 +606,13 @@ function Import-GraphAdministrativeTemplate { $presId = Resolve-TargetPresentationId -TargetPres $tgtPres -SrcPresentation $pres -Counter $typeCounter # Presentation nicht zuordenbar (andere ADMX-Version im Ziel): die GANZE # Einstellung ueberspringen, statt mit unvollstaendigem Body ein 400 zu - # provozieren. - if (-not $presId) { $presFailed = $true; break } + # provozieren. Zur Diagnose Quelle + Ziel-Presentations anhaengen. + if (-not $presId) { + $srcI = "$([string](Get-PolicyProp $pres '@odata.type'))|label='$([string](Get-PolicyProp $pres 'label'))'" + $tgtI = (@($tgtPres) | ForEach-Object { "$([string](Get-PolicyProp $_ '@odata.type'))|label='$([string](Get-PolicyProp $_ 'label'))'" }) -join ' ; ' + $presDiag = "Quelle[$srcI] Ziel[$tgtI]" + $presFailed = $true; break + } } else { $presId = [string](Get-PolicyProp $pres 'id') } @@ -622,7 +628,7 @@ function Import-GraphAdministrativeTemplate { $presVals += $entry } if ($presFailed) { - $errors += "${defName}: Eingabefelder passen nicht zur Ziel-ADMX (andere Version?) - uebersprungen" + $errors += "${defName}: Presentation nicht zuordenbar - uebersprungen. $presDiag" continue }