diff --git a/Extractor.ps1 b/Extractor.ps1 index 1d9ef52..b1b298a 100644 --- a/Extractor.ps1 +++ b/Extractor.ps1 @@ -65,9 +65,25 @@ foreach ($elem in $Elements){ $HashTable } -$lines = Get-Content -Path .\log.txt | ForEach-Object {$_.SubString($_.IndexOf(":")+1)} +function getElems { + param ( + $Path + ) + $lines = Get-Content -Path $Path | ForEach-Object {$_.SubString($_.IndexOf(":")+1)} + $elems = $lines | Out-String -Stream | Select-String -Pattern "VMware-Maschine" | Out-String -Stream + return $elems +} + +function ProcessLogToHash { + param ( + $Path + ) + ProduceHashMap -Elements $(getElems -Path $Path) +} + +<#$lines = Get-Content -Path .\log.txt | ForEach-Object {$_.SubString($_.IndexOf(":")+1)} $elems = $lines | Out-String -Stream | Select-String -Pattern "VMware-Maschine" | Out-String -Stream -ProduceHashMap($elems) +ProduceHashMap($elems)#> <#$HashTable =@{} foreach ($elem in $Elems){ $indexOfFirst = $elem.IndexOf(" ")