There are two GAM commands to run. The first scans the Drives and puts the data into a Google Sheet. I create a tab for each school site in case I need to narrow down where the file is coming from and so I don't run into issues with API limits with Google.
gam ou_and_children "/Students/<school site>" show filelist query "mimeType contains 'html'" fields id,name,createdDate,lastViewedByUser,explicitlyTrashed,fullFileExtension,lastviewedbyuser,filesize,size,alternatelink todrive tdfileid <Sheet file ID> tdsheet id:<Sheet tab ID> tdretaintitle true tdupdatesheet true tdnobrowser true
Then the Sheet uses some formulas to combine and filter the data and preps it for the second GAM command. Make sure the columns are titled with the ~'ed names below. Also, the purge command deletes the file immediately and forever, there is not a way to recover it using that command.
gam csv gsheet <Sheet owner account> <Sheet file ID> <Sheet tab name> gam user ~Owner purge drivefile ~id