I am running this powershell script from my PC and it keeps running out of shared memory and locking up my computer. I am hoping that there may be a better way. This script pulls the last line of my files that contain the row counts. Some of these files have millions of rows.
This is my first powershell script and are very new to it.
$files = Get-ChildItem "O:\Private\WLP_SSIS\Files\Load\Visit_In\"*.txt
foreach ($file in $files)
(Get-Content $file )[-1] | Out-File c:\test\Visit_In_Counts.txt -Append