docker: print logs from windows service after install

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-02-28 20:36:54 +01:00
parent 3b532d1b91
commit 6210eb507a
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

View File

@ -66,3 +66,8 @@ While ($true) {
Start-Sleep -Seconds 1
}
Write-Host "Docker daemon started successfully!"
Get-WinEvent -ea SilentlyContinue `
-FilterHashtable @{ProviderName= "docker"; LogName = "application"} |
Sort-Object @{Expression="TimeCreated";Descending=$false} |
ForEach-Object {"$($_.TimeCreated.ToUniversalTime().ToString("o")) [$($_.LevelDisplayName)] $($_.Message)"}