Error Handling - Exit Code Kontrolü
Script error handling - MSI exit code'ları ve hata yönetimi.
Exit code kontrolü, kurulumun başarılı olup olmadığını programatik olarak belirler. SCCM ve automation için kritiktir.
MSI Exit Codes
- 0: Success
- 3010: Success, restart required
- 1603: Fatal error
- 1618: Another installation in progress
- 1619: Installation package could not be opened
PowerShell Error Handling
- Start-Process msiexec -ArgumentList $args -Wait -PassThru
- $exitCode = $process.ExitCode
- if ($exitCode -eq 0 -or $exitCode -eq 3010) { Write-Host 'Başarılı' }
- else { Write-Error "Kurulum başarısız: Exit code $exitCode"; exit $exitCode }
Logging ve Notification
- Log exit code to file
- Email notification on failure
- SCCM reporting
- Event log entry