Skip to content

Commit 6d28c6f

Browse files
WIP logging
1 parent 3c9954a commit 6d28c6f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

eng/build.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,24 @@ foreach ($config in $configuration) {
352352
foreach ($singleArch in $arch) {
353353
$argumentsWithArch = "/p:TargetArchitecture=$singleArch " + $argumentsWithConfig
354354
Invoke-Expression "& `"$PSScriptRoot/common/build.ps1`" $argumentsWithArch"
355+
356+
$StartTime = (Get-Date).AddMinutes(-5)
357+
Get-WinEvent -FilterHashtable @{LogName="Security"; StartTime=$StartTime; Id=4688} -ErrorAction Ignore | ForEach-Object {
358+
[xml]$EventXml = [xml]$_.ToXml()
359+
$Event = [ordered]@{
360+
TimeCreated = $_.TimeCreated
361+
# Id = $_.Id
362+
# Provider = $_.ProviderName
363+
# Message = $_.Message
364+
# Computer = $_.MachineName
365+
}
366+
$EventXml.Event.EventData.Data |
367+
Where-Object { $_.Name -in @("NewProcessId", "NewProcessName", "ProcessId", "CommandLine", "ParentProcessName") } |
368+
Sort-Object Name |
369+
ForEach-Object { $Event[$_.Name] = $_.'#text' }
370+
[PSCustomObject]$Event
371+
} | Sort-Object TimeCreated | Format-List -Force
372+
355373
if ($lastExitCode -ne 0) {
356374
$failedBuilds += "Configuration: $config, Architecture: $singleArch"
357375
}

0 commit comments

Comments
 (0)