nzahl des Auftretens von Daten im Array
Ich habe ein Array wie dieses:
OptiPlex 790 Precision WorkStation T7500 Precision WorkStation T7400 Precision T1500 Precision WorkStation T3500 CELSIUS R650 VMware Virtual Platform Precision T1500 OptiPlex GX620
Ich möchte die Anzahl der Arrays erhalten und füge diese in das neue Array ein.
Element:Count OptiPlex 790 1 Precision WorkStation T7500 1 Precision WorkStation T7500 1
Ich möchte diesen Wert in einem neuen Array speichern. Also werde ich es später / woanders verwenden.
$array = @()
for ($i=1; $i -le $rowMax-1; $i++) {
$Model = $sheet.Cells.Item($rowModel+$i, $colModel).text
Write-Host ("I am reading data on row: " + $i)
$array += $Model
}
$array | Group
Im Moment funktioniert das obige Skript einwandfrei, aber ich weiß nicht, wie ich diese Daten zu einem neuen Array hinzufügen kann.