adde functions to allow unification of hashmap creation
This commit is contained in:
parent
8f8da682d2
commit
ef7e7b933b
@ -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(" ")
|
||||
|
Loading…
Reference in New Issue
Block a user