1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
$path = '.\palabrafinallargas.txt' # Lento Measure-Command { $text = Get-Content -Path $Path } # Rápido Measure-Command { $text = Get-Content -Path $Path -Raw } # Rápido Measure-Command { $text = Get-Content -Path $Path -ReadCount 0 } # Rápido con .NET Measure-Command { $text = [System.IO.File]::ReadAllText($path ) } |
Fuente original del Tip http://community.idera.com/powershell/powertips/b/tips/posts/reading-text-files-fast-1152612330