PrintAffected to GetAffected, will now only print to screen in switch verbose is given
This commit is contained in:
parent
545d790a8b
commit
49a6f65a76
@ -140,11 +140,19 @@ function buildIntervals {
|
||||
function PrintAffected {
|
||||
param (
|
||||
$listOfIntervals,
|
||||
[datetime]$point
|
||||
[datetime]$point,
|
||||
[switch] $verbose
|
||||
)
|
||||
$array = @()
|
||||
foreach ($elem in $listOfIntervals){
|
||||
if ($point -le $elem.ending -and $point -ge $elem.begining){
|
||||
Write-Host "$point : $($elem.vm) $($elem.state)"
|
||||
if ($verbose) {
|
||||
Write-Host "$point : $($elem.vm) $($elem.state)"
|
||||
}
|
||||
if(!$array.Contains($elem.vm)){
|
||||
$array += @($elem.vm)
|
||||
}
|
||||
}
|
||||
}
|
||||
return $array
|
||||
}
|
@ -12,4 +12,14 @@ snrdaoeisnrdaoie:2024-02-06 20:00:00 some harddrive operation
|
||||
snrdaoeisnrdaoie:2024-02-06 20:00:00 some other Harddrive operation
|
||||
snrdaoeisnrdaoie: VMware-Maschine 'test2'
|
||||
snrdaoeisnrdaoie:aoei aoei VMware-Maschine 'test2'
|
||||
snrdaoeisnrdaoie:2024-02-06 21:00:00 VMware-Maschine 'test2'
|
||||
snrdaoeisnrdaoie:2024-02-06 21:00:00 VMware-Maschine 'test2'
|
||||
|
||||
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'
|
Loading…
Reference in New Issue
Block a user