commandline.info

Logging & Analyse

Einheitliche Logstrategie fuer MSI, EXE, WinGet und PSADT inklusive Parsing-Beispielen.

Logpfade-Standard

TechnikEmpfohlener LogpfadHinweis
MSIC:\Windows\Logs\Software\App-install.log/L*v nutzen
Inno/NSIS/InstallShieldC:\Windows\Logs\Software\App-setup.logHerstellerspezifische Logparameter
WinGetC:\Windows\Logs\Software\winget.log--log nutzen
PSADTC:\Windows\Logs\Software\*PSADT Write-Log standardisieren

Parsing-Snippets

# MSI: kritische Stelle finden
Select-String -Path 'C:\Windows\Logs\Software\app-install.log' -Pattern 'Return value 3' -Context 0,8

# Exit-Code aus Wrapper erfassen
$exit = (Start-Process msiexec.exe -ArgumentList '/i app.msi /qn /L*v C:\Windows\Logs\Software\app.log' -Wait -PassThru).ExitCode
$exit

# PSADT: Errors isolieren
Select-String -Path 'C:\Windows\Logs\Software\*.log' -Pattern 'severity 3|error'