From e8d0c0cd6cbd8a0b4df6f5e69428c95bee30b3ad Mon Sep 17 00:00:00 2001 From: Karl-Wilfried Zimmer Date: Thu, 8 Feb 2024 23:34:31 +0100 Subject: [PATCH] new pairs will now only be added if there is a valid transition --- Extractor.ps1 | 2 +- tests/extractortest malformed fail.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Extractor.ps1 b/Extractor.ps1 index ad8bc7d..a6fd344 100644 --- a/Extractor.ps1 +++ b/Extractor.ps1 @@ -52,7 +52,7 @@ function ProduceHashMap { $lastState=($array[$array.Count-1]).state #Write-Host $lastState #Write-Host $backUpState - if (($lastState -eq 'Failed') -and ($backUpState -eq 'Failed')) { + if (($lastState -eq $backUpState) -or ($backUpState -eq 'Finished' -and $lastState -ne 'Started') -or ($backUpState -eq 'Failed' -and $lastState -ne 'Started')) { #Write-Host "skipping" continue } diff --git a/tests/extractortest malformed fail.txt b/tests/extractortest malformed fail.txt index 8898637..9a78cde 100644 --- a/tests/extractortest malformed fail.txt +++ b/tests/extractortest malformed fail.txt @@ -1,8 +1,11 @@ snrdaoeisnrdaoie:2024-02-06 20:00:00 gestartet VMware-Maschine 'test' +snrdaoeisnrdaoie:2024-02-06 20:00:00 gestartet VMware-Maschine 'test' snrdaoeisnrdaoie:2024-02-06 20:00:00 some harddrive operation nsriadoeisnrdaoei snrdaoeisnrdaoie:2024-02-06 20:00:00 some other Harddrive operation snrdaoeisnrdaoie:2024-02-06 20:01:00 VMware-Maschine 'test' Erfolgreiche +snrdaoeisnrdaoie:2024-02-06 20:01:00 VMware-Maschine 'test' Erfolgreiche +snrdaoeisnrdaoie:2024-02-06 20:01:00 VMware-Maschine 'test' snrdaoeisnrdaoie:2024-02-06 20:00:00 gestartet VMware-Maschine 'test2' snrdaoeisnrdaoie:2024-02-06 20:00:00 some harddrive operation