Streamline OneShot task handler

This commit is contained in:
Manuel Thalmann 2024-08-19 02:24:30 +02:00
parent 76da967793
commit f136ad35ea

View file

@ -104,8 +104,10 @@ $null = New-Module {
};
Write-EventLog -LogName $logName -Source $logName -EventId $oneShotTrigger -Message "Starting OneShot task ``$(Get-OneShotTask)``";
Remove-Event -EventIdentifier (Wait-Event -SourceIdentifier $identifier).EventIdentifier;
$null = Wait-Event -SourceIdentifier $identifier;
for ($i = 0; $i -lt 2; $i++) {
Remove-Event -EventIdentifier (Wait-Event -SourceIdentifier $identifier).EventIdentifier;
}
};
Set-Stage $currentStage;