[ACCEPTED]-Powershell does not release the memory-memory-management
That enforces garbage collection
It seems that there is a memory leak in 3 Get-Content.
[GC]::Collect didn't work in 2 our case when loading ~6000 documents and 1 we had to use a StreamReader instead:
$sr = New-Object System.IO.StreamReader($filepath) ... $sr.Dispose()
More Related questions