It's easy to give advises, but the hard part goes to you. You've already put some effort for a PS script to do it.
SSIS is designed for that, and I think you'll surpass it hurtless. Can you switch your approach then? because adding a column to (all in all) 300 MBs txt file is really a sick operation.
Regards,
Igor
Igor Micev,My blog: www.igormicev.com