*sigh* passing lines of text between nodejs and PowerShell was still causing problems.  Hopefully this might be slightly more reliable.