I'm working on a drive cleanup script in PowerShell. As part of this I'm using the Get-ChildItem
cmdlet to get a list of all files. There are a lot (50k+) of files.
I've thrown the output of the cmdlet into a CSV thinking it will save a bit of RAM. I then import that CSV and process line by line. My understanding is that only the current row of the CSV is loaded into RAM. Is that correct?
If the whole CSV is loaded into RAM as it is processed then this question is moot. In that scenario I'll just chuck the output into a variable for processing.