diff --git a/deploy/windows/Open-TimeProfileReceiptWindow.ps1 b/deploy/windows/Open-TimeProfileReceiptWindow.ps1 index fa531e7..e12cf26 100644 --- a/deploy/windows/Open-TimeProfileReceiptWindow.ps1 +++ b/deploy/windows/Open-TimeProfileReceiptWindow.ps1 @@ -47,8 +47,14 @@ try { Write-Host 'Wartungsfenster aktiv. Dieses Fenster offen lassen. Strg+C beendet es.' $receipt = [ordered]@{session=$session; case_id=$caseId; method='initial_create'; phase='preflight'; read_only_channel=$true} $result = Join-Path $case 'console-initial-create-result.json' + $intentPath = Join-Path $case 'console-initial-create-intent.json' + $failurePath = Join-Path $case 'console-initial-create-error.json' + $receipt.finalizer_invoked = $false try { + if (Test-Path -LiteralPath $failurePath) { throw 'Previous profile finalization error recorded' } if (!(Test-Path -LiteralPath $result)) { + if (Test-Path -LiteralPath $intentPath) { throw 'Previous profile finalization intent without result' } + $receipt.finalizer_invoked = $true $null = & (Join-Path $work 'Complete-OriginalTimeProfile.ps1') -InitialCreate } $record = Get-Content -LiteralPath $result -Raw | ConvertFrom-Json @@ -57,7 +63,7 @@ try { $record.initial_create -ne $true -or $record.source_candidate_preserved -ne $true -or $record.services_changed -ne $false -or $record.private_key_read -ne $false -or $record.clock_runtime_qualified -ne $false -or $actual.Hash -ne '2b4a8a7080770304b80e2a665fa5f5ee1ebbd9182e7c80b184e75b114575b42b') { throw 'Unexpected publication result' } - $marker = Get-Content -LiteralPath (Join-Path $case 'console-initial-create-intent.json') -Raw | ConvertFrom-Json + $marker = Get-Content -LiteralPath $intentPath -Raw | ConvertFrom-Json if ($marker.id -cne $caseId -or $marker.utc -cne $record.publication_since -or $marker.config_sha256 -ne $actual.Hash -or $record.configuration.sha256 -ne $actual.Hash -or $record.original_candidate.file_id -cne '6d990300000003000000000000000000' -or @@ -79,10 +85,24 @@ try { $receipt.line = $_.InvocationInfo.ScriptLineNumber $receipt.file = [IO.Path]::GetFileName($_.InvocationInfo.ScriptName) Write-Warning $_.Exception.Message - $failurePath = Join-Path $case 'console-initial-create-error.json' if (Test-Path -LiteralPath $failurePath) { $failure = Get-Content -LiteralPath $failurePath -Raw | ConvertFrom-Json - if ($failure.id -ceq $caseId -and $failure.hresult -cmatch '^0x[0-9A-Fa-f]{8}$') { $receipt.hresult = $failure.hresult; if ($failure.phase -cmatch '^[A-Za-z][A-Za-z0-9_.-]{0,63}$') { $receipt.failure_phase = $failure.phase } } + if ($failure.id -ceq $caseId -and $failure.hresult -cmatch '^0x[0-9A-Fa-f]{8}$') { + $receipt.hresult = $failure.hresult + if ($failure.phase -cmatch '^[A-Za-z][A-Za-z0-9_.-]{0,63}$') { $receipt.failure_phase = $failure.phase } + $descriptor = $failure.creation_descriptor + if ($failure.phase -ceq 'verify_creation' -and $null -ne $descriptor -and + $descriptor.expected_sddl -is [string] -and $descriptor.expected_sddl.Length -le 4096 -and + $descriptor.actual_sddl -is [string] -and $descriptor.actual_sddl.Length -le 4096) { + $receipt.creation_descriptor = @{ + expected_sddl=$descriptor.expected_sddl; actual_sddl=$descriptor.actual_sddl; bytes=$descriptor.bytes + } + if ($descriptor.file_id -cmatch '^[0-9a-f]{32}$' -and $descriptor.volume_serial -cmatch '^[0-9]{1,20}$') { + $receipt.creation_descriptor.file_id = $descriptor.file_id + $receipt.creation_descriptor.volume_serial = $descriptor.volume_serial + } + } + } } } $readScript = Join-Path $work 'Read-PassiveTimeSamples.ps1' diff --git a/docs/windows-time-profile-config.md b/docs/windows-time-profile-config.md index 3322474..cdc1877 100644 --- a/docs/windows-time-profile-config.md +++ b/docs/windows-time-profile-config.md @@ -488,3 +488,16 @@ um 20:25:35 Uhr MEZ. Präsenz war `online`, die Quelle `windows.base`. Gerät, Agent, Assignment, Enrollmentgeneration und authentifiziertes Zertifikat stimmten mit dem früheren Abnahmebeleg überein. Beleg-SHA-256 `7ea828b42b3c7948956aad56845502ffa52192ce6ca14728203f8574d70a28ec`. + +Der Konsolenstarter prüft im aktualisierten Quellstand vor einem Aufruf des +Abschlussbefehls auf einen vorhandenen Fehler oder einen offenen Intent. +In beiden Fällen liest er den vorhandenen Stand. Die Rückmeldung kennzeichnet +mit `finalizer_invoked`, ob dieser Start den Abschlussbefehl aufgerufen hat. +Enthält der Fehlerbeleg die bei der Erstellung verglichenen Deskriptoren, +überträgt der Starter sie mit der Länge und den vorhandenen Datei-IDs an den +Ergebnisempfänger. Ältere Fehlerbelege bleiben ohne diese Angaben lesbar. + +Der PowerShell-Parser und fünf lokale Fälle bestanden: erster Aufruf, +vorliegender Fehler, offener Intent, bereits vorliegender Erfolg und +widersprüchliche Erfolgs-/Fehlermarker. Nur der erste Fall rief im Test den +simulierten Abschluss auf. Diese Prüfung lief auf dem Entwicklungsrechner.