1 2 3 4 5 6 7 8 9 10 | [System.Collections.ArrayList] $arraylist = New-Object System.Collections.ArrayList #Añadir todas las palabras del fichero al ArrayList (el fichero contiene una palabra por línea) ForEach ($elemento in (gc .\palabras.txt).Split(" ")){ #Agrega un objeto al final de ArrayList [void]$arraylist.Add($elemento) } #Agrupar las palabras para saber cuántas hay en el fichero $arraylist | Group-Object | select Name,Count |