From 545d790a8b2a68c5d5fc1a61fcfd1f36e25a07c0 Mon Sep 17 00:00:00 2001 From: Karl-Wilfried Zimmer Date: Fri, 9 Feb 2024 00:01:51 +0100 Subject: [PATCH] added function to print all vm names that intersect with point --- Extractor.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Extractor.ps1 b/Extractor.ps1 index 1650a4c..f16044a 100644 --- a/Extractor.ps1 +++ b/Extractor.ps1 @@ -135,4 +135,16 @@ function buildIntervals { } } return $array +} + +function PrintAffected { + param ( + $listOfIntervals, + [datetime]$point + ) + foreach ($elem in $listOfIntervals){ + if ($point -le $elem.ending -and $point -ge $elem.begining){ + Write-Host "$point : $($elem.vm) $($elem.state)" + } + } } \ No newline at end of file